Skip to content
Advertisement

Get date-time value instead of default dd/mm/yyyy –:– — on Edit

I have created a bootstrap Modal from which I am taking Debt information, now on debt creation, I don’t have a problem with dd/mm/yyyy –:– — as default (I can remove it using JS and put a placeholder) but when I edit the debt entry, i want to display the values entered instead..

Debt Entry

Editing of debt where I want date values like other fields

JavaScript

How I am getting other values using JS..

JavaScript

Ajax

JavaScript

This ctrShowDebt goes into database and return me the whole record. Returned Object

JavaScript

Advertisement

Answer

Although the input returns the entered values in a local date and time format, the input (for setting the input field) still needs to be in a standardised format like shown below:

JavaScript

JavaScript
JavaScript

So, in the case of your returned data you need to replace the " " with a "T" and you’re done:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement