Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8753 closed defect (fixed)

dojox.date.tests.strftime failure

Reported by: Adam Peller Owned by: Adam Peller
Priority: high Milestone: 1.3
Component: Dojox Version: 1.3.0b1
Keywords: Cc: Tom Trenka, hhelena@…
Blocked By: Blocking:

Description

Tested on FF3/Mac and Chrome/Win?

GROUP "dojox.date.tests.posix" has 5 tests to run
 Error: Bundle not found: gregorian in dojo.cldr , locale=en
     ERROR IN:
  (function test_date_strftime(t) {var date = new Date(2006, 7, 11, 0, 55, 12, 3456);t.is("06/08/11", dojox.date.posix.strftime(date, "%y/%m/%d"));var dt = null;var fmt = "";var res = "";dt = new Date(2006, 0, 1, 18, 23);fmt = "%a";res = "Sun";t.is(res, dojox.date.posix.strftime(dt, fmt, "en"));fmt = "%A";res = "Sunday";t.is(res, dojox.date.posix.strftime(dt, fmt, "en"));fmt = "%b";res = "Jan";t.is(res, dojox.date.posix.strftime(dt, fmt, "en"));fmt = "%B";res = "January";t.is(res, dojox.date.posix.strftime(dt, fmt, "en"));fmt = "%c";res = "Sunday, January 1, 2006 6:23:00 PM";t.is(res, dojox.date.posix.strftime(dt, fmt).substring(0, res.length));fmt = "%C";res = "20";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%d";res = "01";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%D";res = "01/01/06";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%e";res = " 1";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%h";res = "Jan";t.is(res, dojox.date.posix.strftime(dt, fmt, "en"));fmt = "%H";res = "18";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%I";res = "06";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%j";res = "001";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%k";res = "18";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%l";res = " 6";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%m";res = "01";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%M";res = "23";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%p";res = "PM";t.is(res, dojox.date.posix.strftime(dt, fmt, "en"));fmt = "%r";res = "06:23:00 PM";t.is(res, dojox.date.posix.strftime(dt, fmt, "en"));fmt = "%R";res = "18:23";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%S";res = "00";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%T";res = "18:23:00";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%u";res = "7";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%w";res = "0";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%x";res = "Sunday, January 1, 2006";t.is(res, dojox.date.posix.strftime(dt, fmt, "en"));fmt = "%X";res = "6:23:00 PM";t.is(res, dojox.date.posix.strftime(dt, fmt, "en").substring(0, res.length));fmt = "%y";res = "06";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%Y";res = "2006";t.is(res, dojox.date.posix.strftime(dt, fmt));fmt = "%%";res = "%";t.is(res, dojox.date.posix.strftime(dt, fmt));})
 FAILED test: test_date_strftime 4 ms
 PASSED test: test_date_getStartOfWeek 1 ms
 PASSED test: test_date_setIsoWeekOfYear 2 ms
 PASSED test: test_date_getIsoWeekOfYear 1 ms
 PASSED test: test_date_getIsoWeeksInYear 13 ms

Change History (6)

comment:1 Changed 11 years ago by Neil Roberts

Owner: changed from Neil Roberts to Adam Peller

Not sure why this was assigned to me. I wrote the PHP bundle, not the posix bundle

comment:2 Changed 11 years ago by Adam Peller

I thought you had some dependency on the posix code and requested that it be ported. Is it not used anywhere?

Also, you're the project owner for dojox.date, and psowden is not an active contributor.

comment:3 Changed 11 years ago by Neil Roberts

I don't use it anywhere. I don't know why I'm the project owner. Why do you mention psowden? Did he write the original code? Who changed the code that made this module break?

comment:4 Changed 11 years ago by Adam Peller

Cc: Tom Trenka hhelena@… added

Take a look at dojox/date/README. You authored the php module, psowden, I think authored the posix code, and I thought you were using it for dtl at one time, but I guess you're just using php. I wasn't a huge fan of competing date formats, but I remember you stating a case for it and the creation of this project.

I don't know when this regressed, but I believe I ran these tests successfully for the 1.2 release. It seems that maybe the HebrewDate? code set the locale improperly and the posix test didn't explicitly load the locale-sensitive info as it should have.

comment:5 Changed 11 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [16812]) Tests should explicitly load (and unload) locale-sensitive info and never set dojo.locale. Fixes #8753 !strict

comment:6 Changed 11 years ago by Adam Peller

Milestone: tbd1.3

batch move of tickets marked 'tbd' fixed in the 1.3 timeframe

Note: See TracTickets for help on using tickets.