Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Laurens van Rijsbergen
98
Views
5
Comments
Dateformat
Question
Training
I changed the dateformat to of my datepicker to
"
%d-%m-%Y
".
When I click the 'GetAvailableRooms button I get the message 'Date Expected'.
When I retrieve a date from the database it is displayed as "%Y-%d-%m"
Does this mean that the dateformat in the datepicker is not just a display format?
How do I use this properly? That is, display the picked or retrieved date in the specified format but submit it as, well, as a date.
George Jeffcock
Great question!
Have a look at this
https://www.outsystems.com/forums/discussion/10688/date-format-in-input-calender-rich-widget/
George Jeffcock
the work around would be to change the validation to Server side, then check if '
CheckInDate
' failed basic validation...if so reformat the date to match the environment settings format, retest is it valid. If valid update
Booking_CheckInDate
.
Valid flag and booking form valid flag.......
The question would be why do you want these dates entered in a different format than the environment? Change the environment settings?
George Jeffcock
If there is a true business case to have this date formatted differently from the environment setting I guess you could also use JavaScript to reformat the date on submit on the client side, a good chance for you to test the bespoke capabilities of the platform. I would also aim to keep the server side logic as standard as possible, so doing this little bit of javascript formatting on the client side would seem the cleanest solution as this limits the impact to just client side.
Laurens van Rijsbergen
All very well for this partuclar case,but what if there are endusers in different countries with a different datetime format?
I think i need to write a c# module that determines the culture and adapts the datetime format accordingly.
George Jeffcock
Some interesting links about your issue..and so far I can't find a way to change the date format at runtime for the application just by espaces. one to one for countries and espaces? But I can understand that becuase of translations.
Some interesting links about your issue:
About DateFormat property on RichWidgets\Input_Calendar
Configure the Dates Display Format
Customer date formats for input fields
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...