Browse Source
Improve date normalization in abp.js to handle invalid dates
pull/22226/head
maliming
2 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
5 additions and
1 deletions
-
npm/packs/core/src/abp.js
|
|
|
@ -784,9 +784,13 @@ var abp = abp || {}; |
|
|
|
}; |
|
|
|
|
|
|
|
abp.clock.normalize = function (date) { |
|
|
|
if (!date || Object.prototype.toString.call(date) !== '[object Date]' || isNaN(date)) { |
|
|
|
return date; |
|
|
|
} |
|
|
|
|
|
|
|
var kind = abp.clock.kind; |
|
|
|
|
|
|
|
if (kind === 'Unspecified') { |
|
|
|
if (!kind || kind === 'Unspecified') { |
|
|
|
return date; |
|
|
|
} |
|
|
|
|
|
|
|
|