Change date format in Datetimepicker
-
15-04-2021 - |
Frage
Where i need to change in the below code to change date format for datetimepicker in the following javascript:
Curently its show as dd/mm/yyyy hh:mm:ss
But i want it to be dd/mm/yyyy
Keine korrekte Lösung
Andere Tipps
Rather than changing in JQuery lib you can set the format while you call the datetimepicker control.
var date = $('#datepicker').datepicker({ dateFormat: 'dd/mm/yyyy' });
If at all you want to do it in lib only then See this line to change
dateFormat: 'mm/dd/yy', // See format options on parseDate
You need to set this value to whatever you want. i.e. dateFormat: 'dd/mm/yyyy'
Description
You can change the date format in the standard jQuery UI DatePicker using the option dateformat
.
You dont need to change the plugin.
Sample
$( "#MyDatePicker" ).datepicker({ dateFormat: 'dd/mm/yyyy' });
More Information
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow