Outsystems Date Range picker showing one day prior to selected dates
Application Type
Reactive

On debugging the issue on browser console, after selecting the date, can be seen that it's passing the correct date to the 'SelectDate' action of the Outsystems calendar. There is something that happens during the Outsystems data type conversion that causes the date to be a date prior with 24 hr time format. due to which, the range is incorrectly shown on the UI(one day prior to the selected ones. The actual interval selected was 14th-20th June 2021). The initial date is getting calculated rightly and gets highlighted as 14th June. Thanks in advance for any help in this direction.

Champion
Solution

Hi Radhika, 

I think you are investigative widget itself by cloning it. Any way , this is happening because what it's input type is different than text (data type).  That's why it is using server side format.  IST is 5 hours 30 minutes ahead of GMT so what you selecting here actually for variable, it is holding 5 hr 30 minutes before value. It's simple solution is change data type,  Instead  of holding Date time value make it Date data type.


Hope this may help,

Cheers. 


Hi Rahul,

SelectDate is the client action of the DatePicker component. I've not changed the data type of the input. By default, it takes the input in Date-Time format whereas in javascript it is Date object. So,I also had a feeling that if I change data type of the SelectDate client action to Text type, it might work. That' what you are also suggesting, right? I'll try that and post the results here.

Hi Rahul,

I tried changing the data type of the input variable to 'Text'. But came across this issue due to which it is not going into the 'SelectDate' client action.

Champion

Sorry for late reply.  You do not need to change into text. Change it into Date data type.

You didn't get my point. I am saying when data type is different than text. It uses server side format.

Read my last line.

"It's simple solution is change data type,  Instead  of holding Date time value make it Date data type."

So, Date Time and Date these are two different data type. Use Date instead of data time. 


Cheers.

Yes! It worked. In fact, we are using this cloned component only for date range selection. So time is not required. Marked your reply as solution. Thanks a lot

Champion

Hello Radhika

Please find if you can use this example to save the Date Range. Sample Link

OML is attached for reference. 

DatePickerExample.oml

Hi Manish,

Thank you for your response. We had initially implemented this. But since client wanted Outsystems widget itself, we had to clone Outsystems calendar widget to do this. So, we can't go back to forge component unless there is some blocker issue. 

Champion

Okay Radhika

I Understand but if the requirement is only to save the Date Range then we can easily do this with the OutSystems DatePicker Widget as well. 

Please check the below URL, if that works for you: https://personal-9qwkrkgl.outsystemscloud.com/ForumHelp/DateRange?_ts=637599872565418923 


I have not used any forge but only the OS DatePicker 

We needed to clone the picker as it was not showing the initial date range. We needed to show the existing range and the user might need to change it. Else, we could have used it just like you demonstrated, without cloning.

Champion
Solution

Hi Radhika, 

I think you are investigative widget itself by cloning it. Any way , this is happening because what it's input type is different than text (data type).  That's why it is using server side format.  IST is 5 hours 30 minutes ahead of GMT so what you selecting here actually for variable, it is holding 5 hr 30 minutes before value. It's simple solution is change data type,  Instead  of holding Date time value make it Date data type.


Hope this may help,

Cheers. 


Hi Rahul,

SelectDate is the client action of the DatePicker component. I've not changed the data type of the input. By default, it takes the input in Date-Time format whereas in javascript it is Date object. So,I also had a feeling that if I change data type of the SelectDate client action to Text type, it might work. That' what you are also suggesting, right? I'll try that and post the results here.

Hi Rahul,

I tried changing the data type of the input variable to 'Text'. But came across this issue due to which it is not going into the 'SelectDate' client action.

Champion

Sorry for late reply.  You do not need to change into text. Change it into Date data type.

You didn't get my point. I am saying when data type is different than text. It uses server side format.

Read my last line.

"It's simple solution is change data type,  Instead  of holding Date time value make it Date data type."

So, Date Time and Date these are two different data type. Use Date instead of data time. 


Cheers.

Yes! It worked. In fact, we are using this cloned component only for date range selection. So time is not required. Marked your reply as solution. Thanks a lot

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