Define own dateformat in datepicker
Question
Application Type
Reactive

I want to define a specific date format in a Text input in combination with the Datepicker widget but the widget overrides the date format. The documentation says I can use an AdvancedFormat property to prevent the override  but that does not work.

I followed the instructions below, but the datepicker still overrides the input.

Any clues?


Solution

It's working for me when I follow the documentation. 

It's blank on load, then as I select my dates, the format is displayed correctly.

Please check out the attached oml.

That said, this seems to work only as long as 'SelectInterval' is set to True.


DatePickerCustomFormat.oml

Hello @Rogier Olde Dubbelink,

Just using the 'DateFormat' works for me.

For e.g.: 

Regards,

AJ

Thanks AJ, but I want to define my own dateformat like 

If(ExportDate = CurrDate(),"Today's (", If(ExportDate = AddDays(CurrDate(),-1),"Yesterday's (","")) +
FormatDateTime(ExportDate,"dddd, MMM d, yyyy") + 
If(ExportDate = CurrDate() or ExportDate = AddDays(CurrDate(),-1),")", "")

So that is why I want to override the  limited formatting of the Datepicker itself.

Regards,

Rogier


Solution

It's working for me when I follow the documentation. 

It's blank on load, then as I select my dates, the format is displayed correctly.

Please check out the attached oml.

That said, this seems to work only as long as 'SelectInterval' is set to True.


DatePickerCustomFormat.oml

Thanks AJ! The clue was "as long as 'SelectInterval' is set to True". I made the assumption that this had nothing to do with overriding the input.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.