Skip to content

Commit 2ddcc7b

Browse files
authored
fix(calendar): support safari to accept yyyy-mm-dd format
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
1 parent 7225780 commit 2ddcc7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/definitions/modules/calendar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ $.fn.calendar.settings = {
14681468
return null;
14691469
}
14701470
if(text.match(/^[0-9]{4}[\/\-\.][0-9]{2}[\/\-\.][0-9]{2}$/)){
1471-
text += ' 00:00:00';
1471+
text = text.replace(/[\/\-\.]/g,'/') + ' 00:00:00';
14721472
}
14731473
// Reverse date and month in some cases
14741474
text = settings.monthFirst || !text.match(/^[0-9]{2}[\/\-\.]/) ? text : text.replace(/[\/\-\.]/g,'/').replace(/([0-9]+)\/([0-9]+)/,'$2/$1');

0 commit comments

Comments
 (0)