fix displayed dates to be in utc
This commit is contained in:
parent
f07c4c8326
commit
9b29c3d1ad
@ -28,6 +28,13 @@ module.exports = function(eleventyConfig) {
|
||||
return Math.max(1, Math.floor(textOnly.length / readingSpeedPerMin))
|
||||
})
|
||||
|
||||
// get proper date in utc
|
||||
eleventyConfig.addFilter('realDate', (value) => {
|
||||
const actualDate = value;
|
||||
actualDate.setDate(value.getDate() + 1);
|
||||
return actualDate;
|
||||
})
|
||||
|
||||
// Enable us to iterate over all the tags, excluding posts and all
|
||||
eleventyConfig.addCollection('tagList', collection => {
|
||||
const tagsSet = new Set()
|
||||
|
@ -9,7 +9,7 @@ layout: main
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<em>{{ date | date: "%Y-%m-%d" }}</em> ·
|
||||
<em>{{ date | realDate | date: "%Y-%m-%d" }}</em> ·
|
||||
<span>{{ content | readTime }} min read</span>
|
||||
</div>
|
||||
|
||||
|
@ -15,7 +15,7 @@ pagination:
|
||||
<span class="text-2xl sm:text-2xl font-bold hover:text-blue-700 leading-tight"><a href="{{ post.url }}">{{ post.data.title }}</a></span>
|
||||
<span class="text-base sm:text-2xs font-normal"> · {{ post.templateContent | readTime }} min read</span>
|
||||
</p>
|
||||
<em>{{ post.date | date: "%Y-%m-%d" }}</em>
|
||||
<em>{{ post.date | realDate | date: "%Y-%m-%d" }}</em>
|
||||
<p class="mt-4">{{ post.data.post_excerpt }}...</p>
|
||||
|
||||
<div class="flex justify-between items-center mt-4">
|
||||
|
@ -14,7 +14,7 @@ eleventyComputed:
|
||||
<p>
|
||||
<span class="text-2xl sm:text-2xl font-bold hover:underline"><a href="{{ post.url }}">{{ post.data.title }}</a></span>
|
||||
</p>
|
||||
<em>{{ post.date | date: "%Y-%m-%d" }}</em>
|
||||
<em>{{ post.date | realDate | date: "%Y-%m-%d" }}</em>
|
||||
<p class="mt-4">{{ post.data.post_excerpt }}...
|
||||
<span class="hover:underline text-indigo-500"><a href="{{ post.url }}">Read More</a></span>
|
||||
</p>
|
||||
|
Loading…
Reference in New Issue
Block a user