Date format

  • Hello,


    How can I show the date in this format: day (number) + "de" + month (name) + "de" + year


    In Spanish, 5 February 2017 is 5 de febrero de 2017. I tried adding de to j F Y but obviously it didn't work :D. How can do it?


    Regards.

    My styles and plugins in the Plugin-Store.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫

    Edited once, last by Caribe_Soy ().

  • The date pattern uses regular characters for replacement (that's how PHP's date system works), as such you'll need to manually escape characters that are meant literally: j \d\e F \d\e Y. The backspace prevents the replacement and causes the following character to be output "as-is".

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • Thank you, I had only escaped this way: \de, and obviously that didn't work.

    My styles and plugins in the Plugin-Store.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫

  • Apart from CSS, is there another way to display the name of the month in lowercase? In Spanish, the days and months should not be capitalized unless they are used as proper nouns, in the beginning of the sentence, or after period. For a normal date is a grammatical error to capitalize them.


    Regards.

    My styles and plugins in the Plugin-Store.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫

  • The month names are taken straight from your phrases, but I guess making them lower-case is breaking things in some other places. The easiest approach is CSS indeed, the following snippet should do the job:

    CSS
    html[lang="es"] time.datetime {
        text-transform: lowercase
    }

    The selector will not change the case for any other languages except for es (replace with your language code if it differs) and only affects places that display the dynamic date. This should have the desired effect, without having an influence on any other part.

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • Thank you, I feel so stupid ^^, I had completely forgotten about using the language selector, I had used only the time.datetime but obviously that made the months lowercase when English was active.

    My styles and plugins in the Plugin-Store.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫