Hi,
I have the following column:
$col = array();
$col["title"] = "Date";
$col["name"] = "date_off_quay";
$col["width"] = "50";
$col["align"] = "center"; // this column is not editable
$col["sortable"] = false; // this column is not sortable
$col["search"] = true; // this column is not searchable
$col["editable"] = true;
$col["hidden"] = true; // HIDE this column
$col["editrules"] = array("edithidden"=>true,"searchhidden"=>true);
$col["formatter"] = "date";
# opts array can have these options: http://api.jqueryui.com/datepicker/
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'d.m.y', "opts" => array("changeYear" => true, "dateFormat"=>'yy-mm-dd', "minDate"=>"08-04-01", "showWeek"=> true));
It works well – date field get saved in the database as long as I don't change the last instruction to:
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'D d.m.y', "opts" => array("changeYear" => true, "dateFormat"=>'yy-mm-dd', "minDate"=>"08-04-01", "showWeek"=> true));
I need to show the DAY (Monday, Tuesday…), this is why I do try to use: ,"newformat"=>'D d.m.y'
When doing so, the date value is saved as EMPTY in the database.
What is the solution please ?
Thanks
See this working code: line 44
https://gist.github.com/gridphp/291ad626db8d3d4f525367f029fd41da
Thanks Abu.
It almost works.
There is still something to do with the "minDate" … I tried "minDate"=>"Su 01.05.16" …
But the min date does not work… I can only enter from 13/07/2016 for some (format ?) reasons.
Gaëtan
To set minDate, try "minDate"=>"Tue 2.2.16",
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'D d.m.y', "opts" => array("changeYear" => true, "dateFormat"=>'D dd.mm.y', "minDate"=>"Tue 2.2.16", "showWeek"=> true));
Make sure you write correct weekday name.