Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Get translated day of week error

Started by Artyom 9 years ago · 1 replies · 480 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 Thomas, 1 week ago
2 53 9 hours ago
Support · by Anna, 3 days ago
2 59 12 hours ago
Support · by Justin Young, 13 hours ago
1 30 13 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago