Subsribe to our RSS

latest reactions

j
We are in the same situation …
jax
Allthough this doesn't look as if it is…
joe coder
I came across your post from a Google se …
jax
use a public proxy... connect through th …
Tjarko
I use the webservice from maxmind http:/ …

mxna feeds

Transfer's getMemento() has ChangedActive Directory LDAP AuthenticationWho's on the CFMeetup this week,Thurs Aug 21Subversion Makes a Fool out of MeCFMeetup Presentation August 21 @ High NoonColdFusion Academic Version: Curriculum NeededClustering ColdFusionColdFusion Variety Show on August 26 at 6:00ColdFusion Team is looking for feedback from Flex/AIR - CF ShopsHigh Availability Clustering with ColdFusion Article PostedcfExcelProxy - Returning Available StylesBFlex - AIR Messaging: Integrating AIR, BlazeDS, and ColdFusionBFlex - AIR Messaging: Integrating AIR, BlazeDS, and ColdFusionColdFusion Ajax Bindings - Form Fields only?ColdFusion 9 Static Classes

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2008 mximize.com.
All right reserved.

MXNA webfeed

Visit Carlos GallupaPowered by ColdFusion MX

Globalizing ColdFusion - a need for dateformat masks

For a big global application that is currently being developed by my company Carlos Gallupa (http://carlosgallupa.com) I need the following...

Is there a component that can give me based on the used Locale of my application a correct mask/hint on the used dateformat?? We here in the Netherlands use the dateformat dd/mm/yyyy and if I use LSparsedatetime on this while setting te locale to "dutch (standard)" this works great... an vice versa for US dates. But here comes the problem!!!

When my Locale is set dynamicly to a certain Locale, my application does not know what the "mask/hint" of the Locale should be.. in other words "dd/mm" or "mm/dd".

Can someone point me to a good source for answering this question? The best thing would be something like this.

<cfset setLocale("dutch (standard)")>

<cfset stLocale= getlocale()>

<cfoutput>
 #stLocale.name# translates to "dutch (standard)"
 #stLocale.datemask# translates to "dd/mm/yyyy"
</cfoutput>

3058 viewed | 8 opinion(s)  | del.icio.us | Digg it | Tjarko @ 19/06/06 22:55 cet


Reactions:

PaulH wrote.... (site)

i guess you never read the chapter on g11n in the cf advanced book or read my blog ;-) you really *never* want to use custom date masks for localized date strings. use the standard java styles, FULL-->SHORT instead. that way you will always know the format mask and better yet you can parse those localized date strings back to datetime objects.

20 June 2006 4:47 cet  

Tjarko wrote.... (site)

I do read that, and have been an advanced programmer since '98 and an instructor since 2003, I do use long, short etc... what I mean is that the appliction does not know how to input the date... so what do I have to show to the user..

I have a dutch user that inputs it's date as 13/12/1974 (dd/mm/yyyy) but it's browser is set to english.. so the appliction things it's inputting mm/dd/yyyy

I'm not talking about the handling of the date.. that's no problem at all.. i'm talking about communicating to the user what the input mask should be!!

20 June 2006 7:48 cet  

PaulH wrote.... (site)

formatStyle=javacast("int",2); // medium, usually default
locale=createObject("java","java.util.Locale").init("nl","NL");
dateFormat=createObject("java","java.text.SimpleDateFormat").getDateInstance(formatStyle,locale);
writeoutput("#dateFormat.toPattern()#");

21 June 2006 9:05 cet  

Tjarko wrote.... (site)

Mucho Gracias!!

21 June 2006 10:19 cet  

David Ringley wrote.... (mail)

Don't forget to use the locale appropriate abbreviations for day, month and year.In France dd/mm/yyyy would be jj/mm/aaaa.

21 June 2006 15:57 cet  

PaulH wrote.... (site)

if you want that, then use toLocalizedPattern() but be warned that's often transliterations. for instance, try that function w/th_TH locale, it returns "j nnn aaaa" which i can tell you that the average joe blow on the street won't understand.

21 June 2006 19:05 cet  

jax wrote....

Simply do not allow the user to inputa date 'freely'. Use some sort of popup calendar instead.

26 June 2006 16:28 cet  

vacuum cleaners wrote.... (site)

The dateformat thing often upsets me. Most of us in South Africa use the date format dd/mm/yyyy but for some reason when you choose 'South Africa' in most software applications, the date format is something weird life yyyy/dd/mm. I don't know anyone in any business who actually uses that date format. I don't know if that's something that was decided back in the 1970's and is our 'official' date usage, but no one actually uses that date format. It's very frustrating!

06 June 2008 19:15 cet  

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



A dozen apples are how many?? (12 would be a good answer for this)




URL en mail addresses are translated for you... life sometimes is that simple!!