Date Format in Input_Calender rich widget
the default date format is YYYY-MM-DD (2013-08-30) for 30th Aug 2013.
I need to use the format 30-Aug-2013 in my application.
I am successful in displaying the date in 30-Aug-2013 format when I fetch the date saved in database.

The issue is when I select the date in Input box using Input_calender rich widget.
I setup the date format property "%d-%b-%Y" in calender widget which does display the dates in required format however the datatype changes to text and I get an error that date required while saving the data.

The texttodate function doesn't help as it requires text in YYYY-MM-DD format.

Can someone help here please.

We are having the same issue....
Hello Vivek,

You can also change the 'default date display' in service center (administration -> environment configuration), have you already done this?

Kind regards,
Hi Evert,

Thank you for you reply. However, Service center doesn't allow to change the date format to DD-Mon-YYYY (23-Aug-2013)

If we could do that than it would be great. Please suggest
Hello Vivek,

Ahh now it becomes clear. The dateFormat is the dateformat which you have set in the RW calender widget. Then the widgets converts the selected date to text. That text is displayed in the input box and that text should be converted to a date.

Sounds hard, don't know about a function which converts the month to a number from the name (since it would also depends on the selected language).

Is it really needed that when a user selects a date, its shown as 23-Aug-2013? There where you can edit it you can display it as: DD-MM-YYYY and in the lists/show screen you can convert it using the PrettyDateFormat() action?

Kind regards,
Hi Evert,

Indeed it's difficult and we tried following approach. But it has some issue too.

Date format is set to DD-Mon-YYYY in RW calender widget.

On Save, we call an action to do following:
 Input -> Date in text format (DD-Mon-YYYY)
Local variables - Day, Month, Year
Day = Substr(Date,0,2)
Year = Substr(Date,7,4)
Month = Switch loop to convert JAN to 01, FEB to 02 and so on
Output ->FormatedDate (Date Data Type) = TextToDate(Year+"-"+Month+"-"+Day)
                We then assign the FormatedDate to Database variable
Test1Edit.Record.Test1.TestDate1 = FormatedDate
Execute CreateOrUpdate action
All seems good but the Edit Widget gives validation error that ‘Date Expected’
I then removed the validation (Test1Edit) from the Date Input box and date got saved in the database in date format!
I don’t understand now why the Test1Edit widget validation doesn’t recognized the FormatedDate value that we assigned before calling the CreateOrUpdate Action!
What’s wrong?
Hello Vivek,

I'm guessing now so I could be wrong but could it be the client validation on the save button?

The save button in the edit record, is it on 'client and server' validation? And is the TestDate1 attribute in the EditRecord defined as a date type? If so I think the client validation (inputtype date must be date) is giving the error 'date expected', since the input has text (month) instead of a date. The browser checks the fields and the error shown. Set it on server only and it must go right.

Else: would it be possible to make an example eSpace?

Kind regards,
The save button has Server side validation only.
But below is what I did and it worked out. But not an efficient way :(

I created a local variable of text type. Assigned this variable to InputBox where date is being captured in DD-Mon-YYYY format
In the save action we assign formatted date datatype value to Database variable.

This is not giving any validation error while saving.

However, it's too much work. We have to modify the edit page also accordingly!
Any efficient way ?
Has anyone come up with a workable/effiecient solution to this?  I love the date displaying as DD-Mon-YYYY, but it certainly seems like the rich widget should support storing it in the right format.


how to give a condition in if statement only if the date field is entered



With the RichWidgets  'Date_MonthName' and 'Date_PrettyFormat' actions you can modify a datetime to be written (and thus displayed) as wishfull.

Charles, don't reallyunderstand you question, what do you mean?

Kind regards,


I also found error when using DateFormat "%d-%b-%Y" to display date with "DD-MMM-YYYY" format.

New form will display "DD-%b-YYYY" in the date field with the format above.
And for saved data will displayed as "YYYY-MM-DD" format as set in the environment.

When select the date from calendar, the format displayed correctly.
But when try to save got validation message "Date expected!".

Currently workaround using javascript in page onLoad event to fix the date format display.
And for saving data, I am using additional step in Server Action to covert the date value to "YYYY-MM-DD" format before saving.

Is it correct workaround? Or any easier way?



Hi Herry,

I am having the same issue :(

When saving do you use Client & Server validation or only Server?

Can you please share the javascript in page onLoad event that you used?

Thank you in advance.


Also encountering the same issue. Our application is going to be used by both UK and US users and I need to cater for both date formats of DD-MM-YYYY (UK) and MM-DD-YYYY (US)

The right way to use format in that component is "%d-%m-%Y"  using % before each format you want

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