jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Date format
Tagged: Data Format
This topic contains 12 replies, has 4 voices, and was last updated by Peter Stoev 11 years, 9 months ago.
-
AuthorDate format Posts
-
Hello,
I have a problem with the date format in the grid, I get a DateTime from my database and the grid convert it to a cultured format e.g. I have my dat plus two hours (or one depending summer time or not).
Is there a way to avoid it ?
Regards.
Hi cosostones,
I suggest you to look at the Data Sources help topic – http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-datasources.htm. It illustrates how you should bind the Grid and set format of the data fields.
Example: { name: ‘SubmitDate’, type: ‘date’, format: “yyyy-MM-ddTHH:mm:ss-HH:mm” }
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi,
I have to show persian date instead of English date.I have to convert it somewhere.But i can’t found a way ,where i changed for it.Ex:I have to display 23-05-1392 instead of 14-08-2013 in Jqxgrid
Plz help me,(Appreciated)
Thanks,
ManishHello Peter,
I already tried to specifiy the format but the problem is still here.
Regards.
Hi cosostones,
jqxGrid displays the Dates that you load into it. It does not add or remove hours from your dates. I suggest you to store your dates in UTC and then load them into the Grid.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
Can you look into my issue related to farsi/Persian date in column of jqxgrid.Thanks,
ManishHi Manish,
According to me, you will have to apply Persion localization to the Grid – http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-localization.htm
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
It only handles the display part of the string displayed in grid but not convert english date to persian.Plz suggest! Waiting for reply…
Thanks,
ManishI’m sorry Peter but yes the grid add hours, I made a video to show you :
http://screencast.com/t/JaJUwBqzuh
The data are normally loaded but after the date are transformed.
regards.
Hi cosostones,
The Grid does not add hours to your Dates. We use JavaScript Date Object – http://www.w3schools.com/js/js_obj_date.asp for working with Dates, but if you do not like how the default JavaScript Date Object works, you can load your Dates as Strings into the Grid. If your Server Date is in UTC, the Grid will display that Date in Local time as that is the way the JavaScript Date Object works.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Okay thanks for your response I understand the problem.
Regards.
Hi, i work with jqxgrid and specific property cellsformat, if I set ‘d’, this returns a format date. then I change ‘f1’ but the problem is if I type 8.99, automatically rounding 9 and don’t like this, not like rounding! Is possible deactivate rounding?
Hi benitocas88,
‘d’ will return a formatted date in case your column datafield’s type is set to “date”. Otherwise, ‘d’ stands for a whole number, too.
‘f1’ format is for floating number with 1 decimal place so your cell values will be rounded to such with 1 decimal place.
It seems that in your case you should use ‘f2’ as format.Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.