latest reactions

David Levin
Does the trim still work if the form fie …
mal
as long as the join keys are same in eac …
Tarida
I am using ipinfodb.com to redirect the…
David Levin
Good stuff. For those interested in a UD …
PtcBux
oh Wilbur Gans wrote thank you so much…

Clicky Web Analytics
Use OpenDNS
ZERIGO DNS

Ultimate dns hosting based on pre-defined templates, DNS redirection and lot's more.

mxna feeds

Video : Security improvements in ColdFusion 10Adobe ColdFusion Webcast: Evolutions of ColdFusion and Application Predictions for 2013Resolve Stability Problems and SPEED UP ColdFusion 10Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusionNot able to apply Hotfix from ColdFusion 10 Administrator on Windows with Lockdown guide imposed on server. How to setInfinite Scroll Example with ColdFusionColdFusion Summit 2013ColdFusion Dev Needed: Albany, NYCF911: New Adobe document about #ColdFusion security hotfixes: required reading, I'd sayColdFusion Summit AnnouncedAdobe Announces ColdFusion Summit 2013Circular Thumbnails with ColdFusion / CSSColdFusion Dev needed: South FloridaeBay Looking for a ColdFusion DeveloperFace Cropped Thumbnails with ColdFusion

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

Visit Carlos GallupaMXNA webfeed

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>

8867 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..



The answer to the ultimate question is?? (42 ;-))




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