Skip to main content
This topic has been closed for replies.

1 reply

Participant
January 9, 2013

You cannot sort an array that is returned by a java object. CF errors out. You will have to create a new array and loop-and-append to it then sort your array. Like so

<cfset timezoneClass = createObject( "java", "java.util.TimeZone" ) />

<cfset timezoneIDs = timezoneClass.getAvailableIDs()>

<!--- THIS FAILS --->

<cfset arraysort(timezones,"textnocase")>

<!--- THIS SUCCEEDS --->

<cfset timezones = arraynew(1)>

<cfloop array="#timezoneIDs#" index="tzid" >

          <cfset arrayappend(timezones,tzid)>

</cfloop>

<cfset arraysort(timezones,"textnocase")>

WolfShade
Legend
January 9, 2013

Curious.  In your first example, you set timezoneClass and timezoneIDs, but then try to sort timezones (which, AFAICS, you didn't set.)

^_^