How to fixing get wrong value input date by "RichWidgets\Input_Calendar" [Web]

Hallo all, I want to ask some thing important about Web Outsystems

"RichWidgets\Input_Calendar" get some wrong input from (just like image below)

when i debug, i get  (just like image below)

where i have RichWidget just like this (just like image below)

and 

I just want to get right value from input. I really appreciate your solutions, Thanks

Hello Firbert,

Two important things.

1. Are your inputs variable set to the variables you are inspecting?

2. Are you using those variables in the logic? If not, the compiler will optimize your code and the values will not be set, so while you see the variables in debug, their values will be the default data values, not the values you entered in the input.

Cheers.

Hallo Eduardo

1. Yes, of Course

2. Yes, I using it too.


Can you provide an OML with this code so we can take a look?
Or an OML you make that can reproduce the problem?

Cheers.

Hi Firbert,

I've had a similar problem, but it happened when I was using the CustomMask widget to change the date format in a input box.

Turns out, from my analysis, that if the value in the input box isn't in the YYYY-DD-MM format, the platform might fail to convert it from a string to a datetime.

One workaround is to have the input fields bound to text variables and then manually convert the string to the datetime.

Hallo Eduardo, I cannot give my oml to you because this is my company's oml. (my boss will mad with me >_<)

But i can get you that example oml.

Hallo Carlos, I agree about your analysis. But do you have some instant solution to convert date time to dd-MM-yyyy with date data type. Format DateTime is text data type. -_-  

Solution

Hello Firbert,

The solution is to change the date format of the environment, so that now it accepts dd-MM-yyyy.
Other than that, yuo can follow Carlos advice, and do something like the change I made in your code.

Cheers.

Solution

thanks a lot, Eduardo


Eduardo Jauch wrote:

Hello Firbert,

The solution is to change the date format of the environment, so that now it accepts dd-MM-yyyy.
Other than that, yuo can follow Carlos advice, and do something like the change I made in your code.

Cheers.

Changing the date format of the environment is a good idea, because then everywhere you use datetime objects they'll be displayed in that format.

Unless you have to support multiple date formats, that is.