Datetime formatting for day in week

0
Hi,   I’m working on a project in Studio Pro 8 and needed the number of the day in the week (1-7). I knew this format was easily displayed in a Data Grid DateTime column (when custom format is chosen) so I looked it up that way. There, it is said that ‘E’ gives the number of the day in the week. This should be ‘u’. The functionality is implemented correctly by the standards, but the documentation is wrong at this place.   I haven’t checked if this is mistake is also made in previous versions of Mendix.
asked
3 answers
2

The error is not in docs.mendix.com somewhere but in the datagrid widget:

Entering the letter u in the CustomDateFormat field triggers an errormessage showing up ‘invalid format u’, blocking you to get the correct result. And ‘E EE EEE’ gives “Mon Mon Mon”, not "1 01 Mon”.

This is also faulty in 7.20.3 and probably ever since this feature is introduced. You best raise a ticket at support.mendix.com and likely they will solve it in several bugfix-releases.

answered
1

The documentation for the Data Grid widget (and other widgets) is actually correct: the tokens specified in that legend apply to the client-side formatting, which uses the Dojo formatting tokens (where the day-of-week is represented by the token ‘E’). However, the formatting functions in microflows use the Java formatting tokens, which uses ‘u’ for day-of-week.

answered
0

Hi Jord,

If the documentation is wrong then I think you can make a pull request to the documentation to fix it. Check out this link

https://docs.mendix.com/developerportal/community-tools/contribute-to-the-mendix-documentation


In older versions I’ve used ‘u’ with formatedate to get the day of the week as an integer.

answered