From c0c8c846d1a1a1a9c38684fd65c8df4a3f3f5bdd Mon Sep 17 00:00:00 2001
From: MDLeom <2809763-curben@users.noreply.gitlab.com>
Date: Wed, 1 Jul 2020 08:23:48 +0100
Subject: [PATCH] fix(feed): published data should be formatted correctly
- rename 'data' function to 'formatDate' for clarity
---
themes/chameleon/scripts/feed/.atom.xml | 6 +++---
themes/chameleon/scripts/feed/generator.js | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/themes/chameleon/scripts/feed/.atom.xml b/themes/chameleon/scripts/feed/.atom.xml
index e44ed95..672e25b 100644
--- a/themes/chameleon/scripts/feed/.atom.xml
+++ b/themes/chameleon/scripts/feed/.atom.xml
@@ -6,7 +6,7 @@
{% if config.feed.hub %}{% endif %}
- {% if posts.first().updated %}{{ posts.first().updated | date }}{% else %}{{ posts.first().date | date }}{% endif %}
+ {% if posts.first().updated %}{{ posts.first().updated | formatDate }}{% else %}{{ posts.first().date | formatDate }}{% endif %}
{{ url | uriencode }}
{% if config.author %}
@@ -20,8 +20,8 @@
{{ post.title }}
{{ post.permalink }}
- {{ post.date.toISOString() }}
- {% if post.updated %}{{ post.updated | date }}{% else %}{{ post.date | date }}{% endif %}
+ {{ post.date | formatDate }}
+ {% if post.updated %}{{ post.updated | formatDate }}{% else %}{{ post.date | formatDate }}{% endif %}
{% if config.feed.content and post.content %}
{% endif %}
diff --git a/themes/chameleon/scripts/feed/generator.js b/themes/chameleon/scripts/feed/generator.js
index 71c1b74..563ac9e 100644
--- a/themes/chameleon/scripts/feed/generator.js
+++ b/themes/chameleon/scripts/feed/generator.js
@@ -16,7 +16,7 @@ env.addFilter('noControlChars', str => {
return str.replace(/[\x00-\x1F\x7F]/g, '') // eslint-disable-line no-control-regex
})
-env.addFilter('date', str => {
+env.addFilter('formatDate', str => {
return moment(str).format('YYYY-MM-DD[T00:00:00.000Z]')
})