Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Get translated day of week error

Started by Artyom 9 years ago · 1 replies · 768 views
9 years ago

Found a bug with this recipe: {{ 'DAYS_OF_THE_WEEK'|ta(post.date|date('w') - 1) }} when the day is Sunday. post.date|date('w') is equal 0 and minus 1 becomes -1 and I see this on my page: DAYS_OF_THE_WEEK[-1]

How to fix it?

9 years ago

Solved by: {{ 'DAYS_OF_THE_WEEK'|ta(post.date|date('N') - 1) }}

Suggested topics

Topic Participants Replies Views Activity
Support · by TomW, 1 day ago
1 42 23 hours ago
Support · by TomW, 1 day ago
0 48 1 day ago
Support · by TomW, 6 days ago
6 132 2 days ago
Support · by Anna, 2 weeks ago
2 165 6 days ago
Support · by Anna, 4 weeks ago
1 333 4 weeks ago