I have a date column in a grid:
$cold = array();
$cold[“title”] = “FechaFactura”;
$cold[“name”] = “fecha”;
$cold[“width”] = “9”;
$cold[“editable”] = true;
$cold[“formatter”] = “date”;
//$cold[“formatoptions”] = array(“srcformat”=>’Y-m-d’,”newformat”=>’d/m/Y’);
$cols[] = $cold;
If I uncomment de line
//$cold[“formatoptions”] = array(“srcformat”=>’Y-m-d’,”newformat”=>’d/m/Y’);
It doesn’t works. Edit form doesn’t close and it shows a red stripe at the top of the form. With commented line, it close, but the date doesn’t appear in the format I want.
Please share the code for review.
Attach code here and paste link in question.
Attach screenshot here and paste link in question
Code:
https://gist.github.com/mpsistemes/641dee3e99c294c90916c0ac8674c910
Screenshot after “Submit” click:
Solved there is bug in the
jqgrid_dist.php at line 9294
$date=date_format(date_create_from_format($srcfmt,$date), $fmt);
//$date = date_format(date_create($date),$fmt);
commented code is bugy, you have input diferent format and new date need to be transformed to desired format. according to
stack overflow