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.

    Spoiler anzeigen

    — ¡Carajo! —gritó

    Amaranta, que empezaba a meter la ropa en el baúl, creyó que la había picado un alacrán.

    — ¿Dónde está? —preguntó alarmada.

    —¿Qué?

    — ¡El animal!

    Úrsula se puso un dedo en el corazón.

    — Aquí —dijo.

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

    Einmal editiert, zuletzt von Caribe_Soy (7. Februar 2017 um 14:43)

    • Offizieller Beitrag

    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".

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

    My styles and plugins in the Plugin-Store.

    Spoiler anzeigen

    — ¡Carajo! —gritó

    Amaranta, que empezaba a meter la ropa en el baúl, creyó que la había picado un alacrán.

    — ¿Dónde está? —preguntó alarmada.

    —¿Qué?

    — ¡El animal!

    Úrsula se puso un dedo en el corazón.

    — Aquí —dijo.

    ♪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.

    Spoiler anzeigen

    — ¡Carajo! —gritó

    Amaranta, que empezaba a meter la ropa en el baúl, creyó que la había picado un alacrán.

    — ¿Dónde está? —preguntó alarmada.

    —¿Qué?

    — ¡El animal!

    Úrsula se puso un dedo en el corazón.

    — Aquí —dijo.

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

    • Offizieller Beitrag

    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.

  • 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.

    Spoiler anzeigen

    — ¡Carajo! —gritó

    Amaranta, que empezaba a meter la ropa en el baúl, creyó que la había picado un alacrán.

    — ¿Dónde está? —preguntó alarmada.

    —¿Qué?

    — ¡El animal!

    Úrsula se puso un dedo en el corazón.

    — Aquí —dijo.

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

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!