Default Date or years for datepicker

QuestionsDefault Date or years for datepicker
Gary B asked 2 years ago

Hi there, Im trying to set a date in the future as default for the datepicker but cannot seem to get it to work. So far I have tried:
$col[“editoptions”] = array(“size”=>20, “defaultValue”=>”01-01-2020”); // shows current date only
$col[“formatoptions”] = array(“srcformat”=>’Y-m-d’,”newformat”=>’d-m-y’, “opts” => array(“changeYear” => true, “dateFormat”=>’dd-mm-yy’, “minDate”=>”16-04-23”)); // This shows year in white so cant see it, when selecting a year jumps to another field without inserting anything?

Gary replied 2 years ago

Or perhaps maybe better is it possible to have _ _ /_ _ /_ _ _ _

2 Answers
gary answered 2 years ago

Hi, change of approach. Can we use the jquery datepicker to display only month and year similar to this –

Abu Ghufran Staff answered 2 years ago

In your code you have set default date to 01-01-2020
Where later you are setting minimum date selection to 16th April 2023.

$col[“formatoptions”] = array(“srcformat”=>’Y-m-d’,”newformat”=>’d-m-y’, 
                              “opts” => array(“changeYear” => true, 
                              “dateFormat”=>’dd-mm-yy’, “minDate”=>”16-04-23”));

If you wish to select some date in 2020, change minDate param.

Abu Ghufran - Dev Team
PHP Grid Framework
Your Answer

5 + 12 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!