We're updating the issue view to help you get more done. 

ICU4J Holiday.isBetween() locale quirkiness

Description

i'm integrating icu4j w/coldfusion & so far so good until i started in
on the holiday class. it seems like the isBetween method works differently
from ocale to locale (or perhaps i simply don't understand how it works).
for instance, i have a coldfusion component that finds holidays for the
current month which uses the isBetween method w/start & end dates of current
month. it works fine except for en_US locale. fr_CA, en_CA, es_MX, etc. have
holidays defined for this month (sept-2003) & this component finds them
ok. it doesn't however work for en_US, ie its not finding labor day. also
some holidays seem to be defined twice (memorial day & washington's birthday)
for en_US. i see the same behavior with 2.6 & 2.6.1 (beta).

i have a testbed online at:
http://www.sustainablegis.com/projects/calendars/holidaysTB.cfm

below is a simplified version (cfscript, cfmx version 6.1)

<cfscript>
gHolidays = createObject("java","com.ibm.icu.util.Holiday");
aLocale = createObject("java","java.util.Locale");
thisLocale=aLocale.init("en","US"); // just for test
holidays=getHolidays(thisLocale)>
m = month(now());// now is cf function that returns datetime object for "now"
y = year(now());
sDate=createDateTime(y,m,1,0,1,0); //
createDateTime(year,month,day,hour,second)
eDate=createDateTime(y,m,daysInMonth(now()),23,59,0);
holidaysThisMonth=structNew(); //struc is cf data structure for holding key
value pairs
for (i=1; i LTE arrayLen(holidays); i=i+1) {
if (holidays[i].isBetween(sDate,eDate)) {
name=holidays[i].getDisplayName(testLocale);
nextOccurence=holidays[i].firstBetween(sDate,eDate);
if (isDefined("nextOccurence")) //hack for bug, some US holidays have NULL
dates
holidaysThisMonth["#name#"]=nextOccurence;
}
}
</cfscript>

<!--- cfdump just pukes out whatever var/function/method you feed it --->
<cfdump var="#holidaysThisMonth#" label="holidays in
dateFormat(now(),'mmmm-yyyy')#">

Environment

Status

Assignee

Douglas Felt

Reporter

TracBot

Labels

Time Needed

Days

tracCc

srl

tracCreated

Sep 23, 2003, 10:04 AM

tracOwner

doug

tracProject

ICU4J

tracReporter

paul@fa3ae446a58cd7da

tracStatus

accepted

tracWeeks

1

Components

Priority

trivial