Forum
Language for date function
Is it possible to change the language for dates in the Blog app? We mostly do norwegian sites and would like to change for example months like "May" to "Mai". Can't find any translation for this function in the language file for Perch.
You can use strftime formatting codes, which use your server's locale settings.
https://docs.grabaperch.com/docs/templates/attributes/format/
https://php.net/manual/en/function.strftime.php
Do you have a solution to make the first letter capital? Ive found an answer on stackoverflow but it uses php echo. Need to make this work with perch fieldtype "date".
https://stackoverflow.com/questions/10873562/strftime-make-first-letter-capital-uppercase-in-php
I'm not sure I have a solution for that.
Which locale are you using that is not correctly localising the capitalisation?
Im using "no_NO". It shows mandag but need it to show as Mandag. Ive tried some php replace but cant get it to work with perch date, only with php echo.
Can you use
text-transform: capitalise;
in your CSS?Great suggestion. Worked with
text-transform: capitalize;
but needed the month name to be all lowercase. Fixed the problem with psudo:first-letter
. Thanks! Where do I put the setlocal code to get Norwegian time format in Perch dashboard/cms as well?There's a bunch of options you can set in your
config.php
file:https://docs.grabaperch.com/docs/installing-perch/configuration/dates/