Date Format is override by browser date format
Question

Hello everyone,

I'm using OS11 reactive.

I have a Input Date which uses the DatePicker DateFormat like this "DD-MM-YYYY"

If the browser language is in Portuguese i don´t have any problem, the problem is when the browser language is in English. The display date change to the format "MM-DD-YYYY".


Does anyone know how to ensure that the DateFormat is maintained in the browser?


Best and regards

Champion

Hi Tiago,

Not sure about the issue but you can try to use this component.

https://www.outsystems.com/forge/component-overview/2258/input-masks-library


Hope it helps,

Assif

assif_tiger wrote:

Hi Tiago,

Not sure about the issue but you can try to use this component.

https://www.outsystems.com/forge/component-overview/2258/input-masks-library


Hope it helps,

Assif

This is not what i'm looking for.

Thanks 


mvp_badge
MVP

Hi Tiago,

 Use 

SyntaxEditor Code Snippet

FormatDateTime

function to override formate.

look sample oml. 

Hope this will help you.

Regards 

Rahul Sahu

Datetime.oml

Rahul Sahu wrote:

Hi Tiago,

 Use 

SyntaxEditor Code Snippet

FormatDateTime

function to override formate.

look sample oml. 

Hope this will help you.

Regards 

Rahul Sahu

Hi Rahul,

I tried to apply the FormatDateTime, but when choosing a date the input is empty despite the assignment being made. Only when choosing the date again the input is filled.

Another thing, the assign made in the OnInitialize dont have any effect. I guess is a visual problem.

Hi,


context: OutSystems 11 Reactive


I encounter the same issue, and it doesn't seem to be solvable easily.

As far as I can find:

  • The input date formatting follows the browser settings
  • The format in an expression follows the environment settings as mentioned before by Tiago Fernandes which can be changed via FormatDateTime() function.

It is possible to override the browser default for an input field by implementing the reactive Date picker and a lot of tailored logic. 

The tailored logic implies: usage of a local variable, control the input via text-field. 

The complexity rises when you want to view an already present value and use validations too, as the value you enter via the date picker widget sets the date (from your aggregate) directly into the widget and not in the linked local text variable. So when you edit the record, you can see the present value. When you have validations in place that look at the variable content, saying it is mandatory by a check on the variable, this gets a lot more complex.

It is doable, but one should consider the development cost for the tailored and context specific needs.


If anyone finds an easier way, please keep me in the loop :)


I hope this was helpfull to some of you.


Kind regards

Hi,

I had same problem and the following parameter solves my problem:

  1. Open the field that contains the result of the date piker
  2. Check that the variable linked to this field is of type TEXT
  3. Check that the "Input type" value of the field is "Text"

I hope this will be helpful to some of you.

Best regards,

Lionel

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