How to change the visual date format
I am used to a date format like 18 Jan 1999 or at least 18-01-1999. I have set the date format in the settings to DD-MM-YYY, but still the blog displays January 18, 1999.
You'll need to fork your theme and edit it, adjusting the source as follows with information from the reference page.
Specifically, to change the date format for published date:
{{#formatDate}}
DD MMM YYYY
{{/formatDate}}
Which will print 18 Aug 2022. You can find a full list of the operators to adjust your date format on the bottom of the reference docs.
Answered 2 years ago · Edit answerOnce you fork your template, there's also an option to edit the date format in the sidebar on the left of the template editor, under Date format. This won't require any coding on your part
Note that the setting you were changing affects the input format for dates within your own files that Blot reads when it turns them into blog posts – that setting improves the accuracy of Blot's date parser for your folder.
Answered 2 years ago · Edit answerAha, I see. I'll look at it when I fork the template. :-) Thanks for the explanation.
Answered 2 years ago · Edit answerIn which file do I put the code
{{#formatDate}}
DD MMM YYYY
{{/formatDate}}
? Is there a central file for it?
Also, the change in the Settings page of the forked template doesn't seem to affect the visual of the blog -- or do I do something wrong?
Answered 2 years ago · Edit answerYou'd want to replace all the instances of {{date}}
within the template source code. There will be examples of this in entry.html and entries.html among other pages.
However, it sounds like there's a bug with the date settings option – which template are you using? I'll try and fix the issue
Answered 2 years ago · Edit answerI use the Magazine template.
But now I'm confused: Do I have to set the date format in the settings or in all applicable source files???
Answered 2 years ago · Edit answerThe magazine template setting should affect the displayed date format. I'll check and follow up here if there's a bug
Answered 2 years ago · Edit answerI've confirmed that the Magazine template does not respect the date settings in the sidebar, I'll fix this and follow up here. If you'd like an email notification when it's ready, please contact us.
Answered 2 years ago · Edit answerI switched to the Isola template for now - and there the formatDate
code works.
Great, please let me know if anything else comes up or if you have any questions
Answered 2 years ago · Edit answer