Seems that it reports correctly in CF5... But doesn't on CFMX.... Anyone
got any ideas what gives with this?


-----Original Message-----
From: COLLIE David 
Sent: 24 November 2004 13:20
To: '[EMAIL PROTECTED]'
Subject: Week() and DayOfWeek() issues


Can someone confirm that this isn't right and I'm not missing something
obvious?  Cheers.

ISSUE
Week() uses Monday as it's first day of the week
DayOfWeek() uses Sunday as it's first day of the week


CODE
<cfscript>
        test = structNew();
        
        test.saturday = structNew();
        test.saturday.date = createDate(2004,11,20);
        test.saturday.weekNo = week(test.saturday.date);
        test.saturday.dayOfWeek = dayOfWeek(test.saturday.date);
        
        test.sunday = structNew();
        test.sunday.date = createDate(2004,11,21);
        test.sunday.weekNo = week(test.sunday.date);
        test.sunday.dayOfWeek = dayOfWeek(test.sunday.date);

        test.monday = structNew();
        test.monday.date = createDate(2004,11,22);
        test.monday.weekNo = week(test.monday.date);
        test.monday.dayOfWeek = dayOfWeek(test.monday.date);
<cfscript>
<cfdump var="#test#">



OUTPUT
Saturday.weekno = 47 - OK       
Saturday.dayOfWeek = 7 - OK

sunday.weekno = 47 - WRONG?
sunday.dayOfWeek = 1 - OK

monday.weekno = 48 - OK
monday.dayOfWeek = 2 - OK




Assuming it's wrong for the now....
Anybody know of a prebuilt function for fixing this? (I tried the
ISOWeek on cflib) Is this a CFMX issue or all versions (only got access
to CFMX at the moment)?


Cheers



-- 
dc

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185301
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to