On Thu, 2009-10-22 at 11:56 +0200, Hugo Ahlenius wrote:
> Thanks - but for someone not versed in Java - how would I call this from my 
> cfml... ? I am not sure which object(s) I would need to instantiate to get 
> this... 

Here's one solution:
<cfscript>
  locale = CreateObject("java", "java.util.Locale").init("en", "US");
  cal = CreateObject("java", "java.util.Calendar").getInstance(locale);
  dfs = CreateObject("java",
"java.text.DateFormatSymbols").init(locale);
  weekdays = dfs.getWeekdays();
  fdow = cal.getFirstDayOfWeek();
</cfscript>

<cfoutput>#weekdays[fdow + 1]#</cfoutput>

The weird part is the "+1" bit in the array index of weekdays, but at
least when I was messing around with it, array index 1 when you dump the
"weekdays" variable is an empty string, and there are 8 array elements
as opposed to the expected (at least what I expected) 7.

Hope that helps.

-- 
Matthew Woodward
[email protected]
http://mpwoodward.posterous.com
Identi.ca/Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html


--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official site @ http://www.openbluedragon.org/

!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to