Hi,
I'm developing a survey in several languages, and would like to include today's date in one of the questions. Currently, I do this using Expression Manager:
Code:
{date("l F n\t\h, o")} // Output: Tuesday May 5th, 2015
However, this way of formatting the date has several shortcomings:
- The "th" doesn't work for the first, second and third of each month
- For other languages than English, the format is inappropriate. For example, in Norwegian, I would have liked to write "Tirsdag 5. mai, 2015", which requires setting the nb_NO locale. Somehow, this is not achieved by changing the survey language. In fact, not even the survey's standard language affects this (standard language is set to Norwegian, but English is displayed).
Is there a way of linking the locale used for formatting dates in a question, to the language selected by the survey respondent? And, subsequently, how might I include special cases to present dates like 1st, 2nd and 3rd?
Thanks in advance for your help!