beautifulhugo
beautifulhugo copied to clipboard
[Question] How to change dateFormat
Hi!
as I have my blog in spanish (DefaultContentLanguage = "es"), I'd like to have the dates translated; i've seen the dateFormat param, but no matter which changes I make, it doesn't work; could you give me a hint?
I've tried with:
dateFormat = "2 de Enero de 2006" dateFormat = "21/10/2006"
thanks in advance for your time,
Hi @yamila-moreno
You may need to try any of these format, I don't think /
is valid for date formats. Please check this and let me know. Even I am interested to know about Spanish formats (because I am adding Spanish contents in my blog for cross language), I don't know Spanish :)
Cheers
Maybe it could be useful... If you want to translate the days, you need to create a file in /data I link here the doc.
You can get some more infos here: https://gohugo.io/functions/format/
In language "es" the es.yaml is actually not working. The format string "2 de enero, 2006" is not correctly parsed so dates are wrongly formatted in es. You can try replacing "02/01/2006" in the string format in es.yaml to get the dates in the slash format. It is not so nice but works.