Date Formatoptions problem

QuestionsDate Formatoptions problem
Alberto asked 5 months ago

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.


4 Answers
Abu answered 5 months ago

Please share the code for review.

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

Alberto answered 5 months ago
Alberto answered 5 months ago

Can I solve it??

 

Regards

naucnik1977 answered 2 months ago

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

Your Answer

1 + 3 =

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?