forked from extern/egroupware
Make sure invalid date object gets resolved
This commit is contained in:
parent
f4eaaf3d09
commit
8a7840660b
@ -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