mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
use utils.toISOString
This commit is contained in:
@@ -93,7 +93,7 @@ Flags.get = function (flagId, callback) {
|
|||||||
// Final object return construction
|
// Final object return construction
|
||||||
next(err, Object.assign(data.base, {
|
next(err, Object.assign(data.base, {
|
||||||
description: validator.escape(data.base.description),
|
description: validator.escape(data.base.description),
|
||||||
datetimeISO: new Date(parseInt(data.base.datetime, 10)).toISOString(),
|
datetimeISO: utils.toISOString(data.base.datetime),
|
||||||
target_readable: data.base.type.charAt(0).toUpperCase() + data.base.type.slice(1) + ' ' + data.base.targetId,
|
target_readable: data.base.type.charAt(0).toUpperCase() + data.base.type.slice(1) + ' ' + data.base.targetId,
|
||||||
target: payload.targetObj,
|
target: payload.targetObj,
|
||||||
history: data.history,
|
history: data.history,
|
||||||
@@ -203,7 +203,7 @@ Flags.list = function (filters, uid, callback) {
|
|||||||
next(null, Object.assign(flagObj, {
|
next(null, Object.assign(flagObj, {
|
||||||
description: validator.escape(String(flagObj.description)),
|
description: validator.escape(String(flagObj.description)),
|
||||||
target_readable: flagObj.type.charAt(0).toUpperCase() + flagObj.type.slice(1) + ' ' + flagObj.targetId,
|
target_readable: flagObj.type.charAt(0).toUpperCase() + flagObj.type.slice(1) + ' ' + flagObj.targetId,
|
||||||
datetimeISO: new Date(parseInt(flagObj.datetime, 10)).toISOString(),
|
datetimeISO: utils.toISOString(flagObj.datetime),
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}, next);
|
}, next);
|
||||||
@@ -288,7 +288,7 @@ Flags.getNotes = function (flagId, callback) {
|
|||||||
uid: noteObj[0],
|
uid: noteObj[0],
|
||||||
content: noteObj[1],
|
content: noteObj[1],
|
||||||
datetime: note.score,
|
datetime: note.score,
|
||||||
datetimeISO: new Date(parseInt(note.score, 10)).toISOString(),
|
datetimeISO: utils.toISOString(note.score),
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return next(e);
|
return next(e);
|
||||||
@@ -572,7 +572,7 @@ Flags.getHistory = function (flagId, callback) {
|
|||||||
uid: entry.value[0],
|
uid: entry.value[0],
|
||||||
fields: changeset,
|
fields: changeset,
|
||||||
datetime: entry.score,
|
datetime: entry.score,
|
||||||
datetimeISO: new Date(parseInt(entry.score, 10)).toISOString(),
|
datetimeISO: utils.toISOString(entry.score),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user