elvina Posted December 29, 2024 Share Posted December 29, 2024 Hi Bernhard I tried to use the Latte localDate filter in a latte template and I get "Filter not defined". Is there a list of latte filters that are included? I'm just trying to get my date fields to translate as I can't get months to translate without using strftime() which is now depreciated. thanks Link to comment Share on other sites More sharing options...
bernhard Posted December 29, 2024 Share Posted December 29, 2024 RockFrontend includes the HumanDates library that you can use as strftime alternative: $rockfrontend->humandates('de_AT')->format('2025-01-01', 'd. MMMM y') // 1. Jänner 2025 https://github.com/baumrock/HumanDates Link to comment Share on other sites More sharing options...
cwsoft Posted December 29, 2024 Share Posted December 29, 2024 (edited) If it‘s just one language and one or two spots you need to deal with month or weekday names, I tend to use an array with e.g. the month names defined in the Latter template in combination with a PHP date format string like „n“ used as array index pointing to the month name needed (or „N“ for the weekday number). Edited December 29, 2024 by cwsoft Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now