Skip to content
Snippets Groups Projects
Commit 43d1d476 authored by Michael's avatar Michael Committed by GitHub
Browse files

Fix DatePicker on client side

There's an issue in the datepicker on the client side and this fixes the issue.
Issue was that the date was not correctly translated, so when for example we had configured `yyy-MM-dd` and when a user selected a date using the datepicker on the open.php (custom form with date/time field) it showed `201717-January-1818` instead of `2017-01-18`. This PR fixes this issue and I guess it was forgotten by Jared once he made the format i18n aware in commit https://github.com/osTicket/osTicket/commit/0fbc09ad512552b9c356c983121797b0e6c2c22f, in which he changed it on the backend side, but not on the user / frontend side. Tested it with 1.10.

Cheers,
Michael
parent c0ab9679
No related branches found
No related tags found
No related merge requests found
......@@ -173,13 +173,21 @@ getConfig = (function() {
$.translate_format = function(str) {
var translation = {
'd':'dd',
'j':'d',
'z':'o',
'm':'mm',
'F':'MM',
'n':'m',
'Y':'yy'
'DD': 'oo',
'D': 'o',
'EEEE': 'DD',
'EEE': 'D',
'MMMM': '||', // Double replace necessary
'MMM': '|',
'MM': 'mm',
'M': 'm',
'||': 'MM',
'|': 'M',
'yyyy': '`',
'yyy': '`',
'yy': 'y',
'y': 'yy',
'`': 'yy'
};
// Change PHP formats to datepicker ones
$.each(translation, function(php, jqdp) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment