Laverda668 wrote:
> Has anyone seen a tag, or got an algorithm that will
format date ranges?
the latest icu4j has this (maybe overkill for your purposes):
http://www.sustainablegis.com/blog/cfg11n/index.cfm?mode=entry&entry=102C955B-20ED-7DEE-2AA628417A03...
i haven't had a chance to wrap any of this up in a cfc but
this more or less
does what you want:
<cfscript>
// create a date interval now-->4 weeks from now
// DateInterval class wants epoch offsets as LONG hence the
getTime() calls
dI=createObject("java","com.ibm.icu.util.DateInterval").init(now().getTime(),dateAdd("ww",4,now()).getTime());
// create an interval format 3 letter months, 4 digit years,
non-padded dates
diF=createObject("java","com.ibm.icu.text.DateIntervalFormat").getInstance("yMMMd");
writeoutput("#dif.format(di)#");
</cfscript>
which produces:
Jul 16 â Aug 13, 2008
currently this only works for gregorian calendar.