Thursday, October 25, 2012

If needed: Force Users to Enter Dates Your Way


Wow!  So much to write and so little time!

Between the documentation, the policies, the XPages Bootcamp, Beacon Award submission, Lotusphere, uh, IBM Connect Abstracts (Yes, I will once again be playing the abstract lottery game even though I am the Susan Lucci of Lotusphere speaking), contracts, meetings, report creation, a video series on managed beans and the odd social nuclear blast...it's amazing I have any time to code at all.

But I do code and I also have a pile of draft blog tips to share.  Whew!

A quick tip for today...

I prefer the jQueryUI calendar to the built in Dojo calendar.  I have good reasons which I will post about at another time.

I deployed the nifty little calendar and, lo!, those darn users in other countries could not save dates into the XPage!

Having run across this issue before I rushed to the properties and changed the locale setting for the field and Bam! data entry resumed.  Of course this is not the only way to resolve this issue and one can argue the issues surrounding forcing non-US users to enter data using the US format but that isn't the point of this post.

The point of this post is: If you find yourself in a situation where you need your XPage to only accept a specific date locale format despite the user's actual location, remember to use the locale property on your date field.

Enjoy!