From 4122ae2bc61decfe42ab1fb2423171320798a5b1 Mon Sep 17 00:00:00 2001 From: ArmorDarks Date: Wed, 4 Oct 2017 19:01:13 +0300 Subject: [PATCH] [package][task] drop `moment.js` in favor of native `Date()` function --- CHANGELOG.md | 1 + package.json | 1 - tasks/sitemap_xml.js | 3 +-- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 832b487..8dd1415 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ When set to `false`, all trailing slashes from URLs will be removed. +- Dropped `moment.js` in favor of simple `new Date().toISOString()` as a default value for `lastMod` option. - `package.json` cleanups. - Added `package.json` `main` property pointing to the task file. - Added `snazzy` for better `standard` output. diff --git a/package.json b/package.json index 08dd3ec..fecbb55 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ ], "dependencies": { "chalk": "^2.0.0", - "moment": "^2.14.1", "xmlbuilder": "^9.0.0" }, "devDependencies": { diff --git a/tasks/sitemap_xml.js b/tasks/sitemap_xml.js index dce93e4..03df961 100644 --- a/tasks/sitemap_xml.js +++ b/tasks/sitemap_xml.js @@ -8,7 +8,6 @@ 'use strict' const chalk = require('chalk') -const moment = require('moment') const builder = require('xmlbuilder') module.exports = function (grunt) { @@ -22,7 +21,7 @@ module.exports = function (grunt) { siteRoot: pkg.homepage, stripIndex: true, trailingSlash: true, - lastMod: moment().format('YYYY-MM-DDTHH:mm:ssZ'), + lastMod: new Date().toISOString(), priority: '0.5', changeFreq: 'weekly', pretty: false