@abp/core
Advanced tools
Comparing version 2.8.0 to 2.9.0
@@ -0,0 +0,0 @@ module.exports = { |
{ | ||
"version": "2.8.0", | ||
"version": "2.9.0", | ||
"name": "@abp/core", | ||
@@ -8,5 +8,5 @@ "publishConfig": { | ||
"dependencies": { | ||
"@abp/utils": "^2.8.0" | ||
"@abp/utils": "^2.9.0" | ||
}, | ||
"gitHead": "40e535594fe6371da41ed3af28df92ee43def52c" | ||
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431" | ||
} |
@@ -666,2 +666,58 @@ var abp = abp || {}; | ||
})(); | ||
/* CLOCK *****************************************/ | ||
abp.clock = abp.clock || {}; | ||
abp.clock.kind = 'Unspecified'; | ||
abp.clock.supportsMultipleTimezone = function () { | ||
return abp.clock.kind === 'Utc'; | ||
}; | ||
var toLocal = function (date) { | ||
return new Date( | ||
date.getUTCFullYear(), | ||
date.getUTCMonth(), | ||
date.getUTCDate(), | ||
date.getUTCHours(), | ||
date.getUTCMinutes(), | ||
date.getUTCSeconds(), | ||
date.getUTCMilliseconds() | ||
); | ||
}; | ||
var toUtc = function (date) { | ||
Date.UTC( | ||
date.getUTCFullYear(), | ||
date.getUTCMonth(), | ||
date.getUTCDate(), | ||
date.getUTCHours(), | ||
date.getUTCMinutes(), | ||
date.getUTCSeconds(), | ||
date.getUTCMilliseconds() | ||
); | ||
}; | ||
abp.clock.now = function () { | ||
if (abp.clock.kind === 'Utc') { | ||
return toUtc(new Date()); | ||
} | ||
return new Date(); | ||
}; | ||
abp.clock.normalize = function (date) { | ||
var kind = abp.clock.kind; | ||
if (kind === 'Unspecified') { | ||
return date; | ||
} | ||
if (kind === 'Local') { | ||
return toLocal(date); | ||
} | ||
if (kind === 'Utc') { | ||
return toUtc(date); | ||
} | ||
}; | ||
})(); |
Sorry, the diff of this file is not supported yet
23210
619
Updated@abp/utils@^2.9.0