diff --git a/ghost/core/core/frontend/services/sitemap/BaseSiteMapGenerator.js b/ghost/core/core/frontend/services/sitemap/BaseSiteMapGenerator.js index 3f60c69f18..cfbd119dd9 100644 --- a/ghost/core/core/frontend/services/sitemap/BaseSiteMapGenerator.js +++ b/ghost/core/core/frontend/services/sitemap/BaseSiteMapGenerator.js @@ -1,6 +1,5 @@ const _ = require('lodash'); const xml = require('xml'); -const moment = require('moment'); const path = require('path'); const urlUtils = require('../../../shared/url-utils'); const localUtils = require('./utils'); @@ -96,23 +95,24 @@ class BaseSiteMapGenerator { } /** - * @returns {moment.Moment} + * @returns {Date} */ getLastModifiedForDatum(datum) { if (datum.updated_at || datum.published_at || datum.created_at) { const modifiedDate = datum.updated_at || datum.published_at || datum.created_at; - return moment(modifiedDate); + return new Date(modifiedDate); } else { - return moment(); + return new Date(); } } updateLastModified(datum) { const lastModified = this.getLastModifiedForDatum(datum); + const lastModifiedTime = lastModified.getTime(); - if (lastModified > this.lastModified) { - this.lastModified = lastModified; + if (lastModifiedTime > this.lastModified) { + this.lastModified = lastModifiedTime; } }