Updating Date Field

QuestionsUpdating Date Field
Alfonso Cabrera asked 9 years ago

Hi!

When ever I update a row in my grid, it always change the date to: 01-Jan-1970. Why?
I'm not updating the date field, only the other ones.

If you need my source code just tell me.

Thank you.

4 Answers
Abu Ghufran answered 9 years ago

Please email me code at [email protected]
Also send database sql dump.

Alfonso Cabrera answered 9 years ago

Hi Abu

I think I found the problem, when ever I update a row with January, April, August or December it changes the date to blank.
I already checked in the other grid and it happens the exact same issue.

January – Enero
April – Abril
August – Agosto
December – Diciembre

As you can see, these 4 months are different and that may cause the problem.
If you watched the video, you can see that the grid update the 3 letters of the month name, from Dec to Dic becasue I use the Spanish localization.

I hope it helps.

Alfonso Cabrera answered 9 years ago

setlocale(LC_TIME, 'spanish');
date_default_timezone_set("America/Mexico_City");

This could affect the update query when the grid send the data to the database?

Abu Ghufran answered 9 years ago

This could be a solution, but we are not using strftime() inside lib. We are using strtotime that does not support setlocale() function.

2 solutions:

1. rename the shortnames to english in spanish localization file of grid.
2. using custom on_update handler, search and replace 'Dic' to 'Dec' before it goes to database.

Emailed you sample for #2.

Your Answer

19 + 19 =

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?