new Date().getTime() to Date.now()

This commit is contained in:
djmaze 2020-08-17 21:35:03 +02:00
parent 7670d2073d
commit 1b811428e7
3 changed files with 5 additions and 5 deletions

View file

@ -255,7 +255,7 @@ export function getUploadErrorDescByCode(code) {
* @param {string} language
*/
export function reload(admin, language) {
const start = new Date().getTime();
const start = Date.now();
$htmlCL.add('rl-changing-language');
@ -288,7 +288,7 @@ export function reload(admin, language) {
resolve();
},
500 < (new Date().getTime()) - start ? 1 : 500
500 < Date.now() - start ? 1 : 500
);
});
});

View file

@ -130,7 +130,7 @@ class AbstractAjaxRemote {
ajaxRequest(fResultCallback, params, iTimeOut = 20000, sGetAdd = '', abortActions = []) {
params = params || {};
const isPost = !sGetAdd,
start = new Date().getTime(),
start = Date.now(),
action = params.Action || '';
if (action && abortActions) {
@ -181,7 +181,7 @@ class AbstractAjaxRemote {
.then(oData => {
let cached = false;
if (oData && oData.Time) {
cached = pInt(oData.Time) > new Date().getTime() - start;
cached = pInt(oData.Time) > Date.now() - start;
}
if (oData && oData.UpdateToken) {

View file

@ -61,7 +61,7 @@ const __set = (key, value) => {
}
};
const timestamp = () => Math.round(new Date().getTime() / 1000);
const timestamp = () => Math.round(Date.now() / 1000);
const setTimestamp = () => __set(TIME_KEY, timestamp());