jQuery UI Widgets › Forums › Grid › Problem with date column in jqxgrid
Tagged: #jqwidgets-grid, grid, javascript grid, jquery grid
This topic contains 7 replies, has 3 voices, and was last updated by Manu Vashishtha 4 years, 11 months ago.
-
Author
-
Dear Sir
I am facing a problem in jqxgrid date column. I am binding the grid data from database with a date column of format “dd/MM/yyyy”. When I am updating the row then format of date column is changed to mm/dd/yyyy . This happens only when we have day less than 12. I have created an example for this in jsfiddle: js fiddle example. When you update the row by clicking the button and then click on the date type cell of same row then day is changed to month.
Its working fine when I convert date string(“dd/MM/yyyy”) to javascript date[new date()]. But I cannot convert the string to date every time because I have to bind the row data as it is and its not easy for me to convert every time. Is there any other way to do it like I have to set a property or call a method.Its urgent for my project. Please help me if you have solution for this.
Thanks & Regards
Manu vashishthaHello Manu Vashishtha,
You could use the
format
member to the ‘datafield’ which is relevant to the date.
Please, take a look at this forum topic.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHello Hristo Hristov,
Thank you for your response.
I already tried this in my project. This is working fine for showing the data in grid but there is a problem when I have to edit the row and month is less than 12. I have attached the example with using “format” property in “datafield”:–Please Check the example...Thanks & Regards,
Manu VashishthaHello Manu Vashishtha,
Could you clarify it?
It seems the update is valid.
When using the buttons in your example to update the selected row it set date “10/09/2018” as it is set.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comHello Hristo,
You are right it updates the row but problem arises when you click on the same cell(date type) which is updated.
Then, the day is changed into month.Thanks & Regards,
Manu Vashishtha“it updates the row but problem arises when you click on the same cell(date type) which is updated.
Then, the day is changed into month.”What is the final solution then?
Hello tong123123,
I would like to suggest you try to parse the new value with the “Date” object then add as records.
Please, take a look at this example.
Meanwhile, I will create a work item to discuss this scenario.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comHello Hristo,
I have also resolved this problem by converting value to date object. And it is working fine for me now. -
AuthorPosts
You must be logged in to reply to this topic.