mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
Updated last mentions report timestamp to use number
Co-authored-by: Simon Backx <simon@ghost.org>
This commit is contained in:
parent
266c70a8fd
commit
d98ffcff28
@ -72,21 +72,21 @@ module.exports = {
|
||||
const mentionReportHistoryService = {
|
||||
async getLatestReportDate() {
|
||||
const setting = settingsCache.get('lastMentionsReportEmailTimestamp');
|
||||
const parsedDate = Date.parse(setting);
|
||||
const parsedInt = parseInt(setting);
|
||||
|
||||
// Protect against missing/bad data
|
||||
if (Number.isNaN(parsedDate)) {
|
||||
if (Number.isNaN(parsedInt) || !parsedInt) {
|
||||
const date = new Date();
|
||||
date.setDate(date.getDate() - 1);
|
||||
return date;
|
||||
}
|
||||
|
||||
return new Date(parsedDate);
|
||||
return new Date(parsedInt);
|
||||
},
|
||||
async setLatestReportDate(date) {
|
||||
await models.Settings.edit({
|
||||
key: 'lastMentionsReportEmailTimestamp',
|
||||
value: date
|
||||
value: date.getTime()
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user