Skip to content

Commit

Permalink
fix(calendar): support safari to accept yyyy-mm-dd format
Browse files Browse the repository at this point in the history
After implementing #1462, a pure given date in yyyy-mm-dd format did not work in safari anymore , because safari does not handle the internal converted date of yyyy-mm-dd 00:00:00

This PR now changes the dashes to slashes, so the internal result is yyyy/mm/dd 00:00:00, which is supported in every browser
  • Loading branch information
lubber-de authored Aug 19, 2020
1 parent 7225780 commit 2ddcc7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ $.fn.calendar.settings = {
return null;
}
if(text.match(/^[0-9]{4}[\/\-\.][0-9]{2}[\/\-\.][0-9]{2}$/)){
text += ' 00:00:00';
text = text.replace(/[\/\-\.]/g,'/') + ' 00:00:00';
}
// Reverse date and month in some cases
text = settings.monthFirst || !text.match(/^[0-9]{2}[\/\-\.]/) ? text : text.replace(/[\/\-\.]/g,'/').replace(/([0-9]+)\/([0-9]+)/,'$2/$1');
Expand Down

0 comments on commit 2ddcc7b

Please sign in to comment.