mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-11 11:18:47 +08:00
parse unix timestamps with decimal points (issue 826)
This commit is contained in:
+2
-2
@@ -146,8 +146,8 @@ function parseDate(s, ignoreTimezone) { // ignoreTimezone defaults to true
|
||||
return new Date(s * 1000);
|
||||
}
|
||||
if (typeof s == 'string') {
|
||||
if (s.match(/^\d+$/)) { // a UNIX timestamp
|
||||
return new Date(parseInt(s, 10) * 1000);
|
||||
if (s.match(/^\d+(\.\d+)?$/)) { // a UNIX timestamp
|
||||
return new Date(parseFloat(s) * 1000);
|
||||
}
|
||||
if (ignoreTimezone === undefined) {
|
||||
ignoreTimezone = true;
|
||||
|
||||
@@ -83,6 +83,10 @@
|
||||
start: new Date(y, m, 28),
|
||||
end: new Date(y, m, 29),
|
||||
url: 'http://google.com/'
|
||||
},
|
||||
{
|
||||
title: 'Float String Timestamp Event',
|
||||
start: '1295078400.0'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user