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
Justin James
MVP
15
Views
12
Comments
Customer date formats for input fields
Question
Is there any way to specify the format of a date/time input field on the screen using a format other than the server's format?
The problem that we're having is that we have customers in many difference regions. We can format dates in expressions just fine. But when we display data in an edit record on the screen, it uses the server's date format, even if the input calendar widget attached to the input field uses the customer's date format. When the date is selected from the calendar, it goes onto the field correctly, but if the field is Ajax Refreshed, and on initial preparation, it uses the server's date format.
We're using version 7. Any ideas here?
Thanks!
J.Ja
Robbie Nati
Same problem here J.
Had to include unnecessary actions just to have the format display correctly for our region (dd/mm/yyyy).
There must be a better way???
-Robbie
João Rosado
Staff
Hi Justin,
Did you try the date picker from
jQuery Goodies component
?
From the component description: "Datepicker (format it any way you want without having to match defined format in service center)"
Regards,
João Rosado
Justin James
MVP
Joao -
My problem isn't what happens when the data picker selects a date; that works fine with the built-in picker. My problem is what is populated into the input field on Preparation or any other screen action.
Does the jQuery component fix that?
J.Ja
João Rosado
Staff
Hi Justin,
Tweaked the component demo to include a refresh with highlight. You can see it
here
.
(The overall sample application needs a lot of work though)
Regards,
João Rosado
Justin James
MVP
Joao -
Thanks! That looks like it will do what we need it to do. I'm talking to my team to see if we can start using this one instead.
J.Ja
Robbie Nati
This component works great for something that requires a recent date value.
What is the component was used to select the users Date of birth for example. The only way to select the date is to scroll through the months until the month of birth is reached. For a user that is 50 years old, this would require clicking the back back 50 x 12 times. Not a very good user experience.
Is there a way to add a year scroll button?
Thanks
-Robbie
João Rosado
Staff
Hey Robbie,
Sure,
next version preview demo
with customizable calendars.
Still some work to be done.
Regards,
João Rosado
Cory Creamer
I'm trying to use this to display dates in the dd-M-yy format (08-May-2014) but I'm running into a couple problems. We have a page where someone can add or edit (both via the same popup) Certifications/Licenses they hold. There is a date the certification was obtained. In the preparation we do a standard GetCertificationsById - if they are adding a record, we have a blank one to work with, if they are editing an existing one then we have the appropriate identifier passed to get the right record. We then assign the GetCertificationsById.List.Current.xxx fields to the input widgets on the screen.
Whatever date I select, it is always getting stored as 01-01-1900. If I try to debug it, I get that variable is unavailable in current context. Any idea why?
If I have a date in the field when the screen comes up for edit, it displays it in the default server format of 08-05-2014 (dd-mm-yyyy), it won't change the format until I actually select a date.
I also don't like that the prompt on the field shows up as DD-M-YYYY - how can I change that?
I can get around all of it (except the prompt issue) by using local text variables for the dates that I assign in the preparation by calling a function to convert the date to a text date in the right format. Then on the save action I convert the text date to an actual date and assign it to the database before the InsertOrUpdate action. A lot of trouble, but if that is the requriement from the business, we will do it.
Any ideas for a cleaner way?
Cory
Cory Creamer
I've got another problem on one screen where I am using the datepicker. The calender will popup until I select a date. After a date has been selected, I can't get it to pop up again on that input field (unless I refresh the screen). It isn't doing this on other screens where I am using the datepicker.
Any thoughts?
Cory
Justin James
MVP
Cory -
Sounds like you are doing an Ajax Refresh on the date field widget somewhere. This will occassionally give it a new ID, so unless you also Ajax Refresh the InputCalendar widget, or Ajax Refresh something that encloses both of them, the InputCalendar widget will be pointing to the wrong ID and disconnected to the field currently on the screen.
J.Ja
Cory Creamer
THANK YOU! That was exactly the problem.
Cory
Justin James
MVP
Great, glad that did it! This applies to PopupEditor as well, that's another common one for this problem to happen on.
J.Ja
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...