Default Date or years for datepicker

QuestionsDefault Date or years for datepicker
Gary B asked 6 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 6 years ago

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

2 Answers
gary answered 6 years ago

Hi, change of approach. Can we use the jquery datepicker to display only month and year similar to this – http://jsfiddle.net/DBpJe/7755/

Abu Ghufran Staff answered 6 years ago

Hi,
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
Grid 4 PHP Framework
 
Your Answer

0 + 10 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?