mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-03 12:00:09 +01:00
Make sure invalid date object gets resolved
This commit is contained in:
parent
78fa78983c
commit
de714fae8e
@ -251,7 +251,7 @@ function date (format, timestamp) {
|
||||
};
|
||||
this.date = function (format, timestamp) {
|
||||
that = this;
|
||||
jsdate = ((typeof timestamp === 'undefined') ? new Date() : // Not provided
|
||||
jsdate = ((typeof timestamp === 'undefined' ||isNaN(timestamp.valueOf())) ? new Date() : // Not provided
|
||||
(timestamp instanceof Date) ? new Date(timestamp) : // JS Date()
|
||||
new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user