Formatting Date from Regular Input and Input_Calendar Widget Input

Formatting Date from Regular Input and Input_Calendar Widget Input


Hi guys,

I currently have an input field and I wish the user to enter the date in an input in the specific format DD/MMM/YYYY (eg. 05/May/2018) while also giving the user the option of picking that date from the Input_Calendar richwidget. 

I then want to store the input in a structure with the Date datatype.

The problem is that the input is originally in text format and the TextToDate built-in function requires the text to be in YYYY/MM/DD format.

Basically I need to convert text with format DD/MMM/YYYY to a date with format YYYY/MM/DD and then store it into a date structure.

I think that I will need javascript to split the original text and then convert each part of the text (date, month, year) into their respective date types. However, I have very little experience with javascript.

Does anyone have any ideas how I should solve this problem?

Hi Andy,

If you want to convert  DD/MMM/YYYY to YYYY/MM/DD than you can do in javascript But as you are saying you have little experience in java script than you can also do in outsystems . Create a function that accept text as input and split that text by "/" . and then create a output in format YYYY/MM/DD . for month converting from mmm outsystems doesn't have any method so you need to write a if else better switch for converting JAN to 01