Forum

Thread tagged as: Error

"Mar" breaks date field

I have an input field for a date, like:

<perch:content id="newsdate" type="date" label="Date" required="true" title="true" divider-before="Column left" format="%e. %B %Y" />

Outputting works well, until I select "Mar" for the month. Then no date is output at all in the frontend. All other months work fine.

When I set "%d.%m.%Y" as the format, there is no problem with "Mar".

Any ideas on how to output the date in the desired format (e.g. "1. März, 2014") without errors? The date needs to be localized, as the page is bilingual.

Nils Mielke

Nils Mielke 3 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you using the UTF8 version of your server locale?

How do I find out? Currently I use "setlocale(LC_ALL, "de_DE");" in the header.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Try de_DE.UTF-8

Works like a charm.

Thank you very much for your fast problem solving, Drew.