[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: ISO8601 Week number

Status
Not open for further replies.
L

Lieven De Foor

Guest
The version on ProgressTalk is not 100% correct! We have implemented a DateToIsoWeekDate() conversion method (sorry, can't share), and written unit tests for a lot of edge cases. For 1 January 2006 the Iso Week Date is "2005-W52-7", but the code on ProgressTalk returns week 53... Besides, it should return a full string like above instead of only a week, as it needs the year is essential information (it could be in the next or previous year) As for the good news, that date seems to be the only for which my unit tests are failing for the ProgressTalk implementation... I can share the test cases and results though: MESSAGE ISOWeekNumber(1/1/2005) /* "2004-W53-6" */ SKIP ISOWeekNumber(1/2/2005) /* "2004-W53-7" */ SKIP ISOWeekNumber(12/31/2005) /* "2005-W52-6" */ SKIP ISOWeekNumber(1/1/2006) /* "2005-W52-7" */ SKIP ISOWeekNumber(1/2/2006) /* "2006-W01-1" */ SKIP ISOWeekNumber(12/31/2006) /* "2006-W52-7" */ SKIP ISOWeekNumber(01/01/2007) /* "2007-W01-1" */ SKIP ISOWeekNumber(12/30/2007) /* "2007-W52-7" */ SKIP ISOWeekNumber(12/31/2007) /* "2008-W01-1" */ SKIP ISOWeekNumber(01/01/2008) /* "2008-W01-2" */ SKIP ISOWeekNumber(12/28/2008) /* "2008-W52-7" */ SKIP ISOWeekNumber(12/29/2008) /* "2009-W01-1" */ SKIP ISOWeekNumber(12/30/2008) /* "2009-W01-2" */ SKIP ISOWeekNumber(12/31/2008) /* "2009-W01-3" */ SKIP ISOWeekNumber(01/01/2009) /* "2009-W01-4" */ SKIP ISOWeekNumber(12/31/2009) /* "2009-W53-4" */ SKIP ISOWeekNumber(01/01/2010) /*"2009-W53-5" */ SKIP ISOWeekNumber(01/02/2010) /* "2009-W53-6" */ SKIP ISOWeekNumber(01/03/2010) /* "2009-W53-7" */ VIEW-AS ALERT-BOX. en.wikipedia.org/.../ISO_week_date

Continue reading...
 
Status
Not open for further replies.
Top