diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
commit | 1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch) | |
tree | 3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojo/tests/date/stamp.js | |
parent | 104d59099e048688c4dbac37d72137006e396558 (diff) | |
download | semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2 |
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojo/tests/date/stamp.js')
-rw-r--r-- | includes/js/dojo/tests/date/stamp.js | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/includes/js/dojo/tests/date/stamp.js b/includes/js/dojo/tests/date/stamp.js deleted file mode 100644 index 88cf677..0000000 --- a/includes/js/dojo/tests/date/stamp.js +++ /dev/null @@ -1,94 +0,0 @@ -if(!dojo._hasResource["tests.date.stamp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests.date.stamp"] = true; -dojo.provide("tests.date.stamp"); - -dojo.require("dojo.date.stamp"); - -tests.register("tests.date.stamp", - [ -function test_date_iso(t){ - var rfc = "2005-06-29T08:05:00-07:00"; - var date = dojo.date.stamp.fromISOString(rfc); - t.is(2005,date.getFullYear()); - t.is(5,date.getMonth()); - t.is(29,date.getUTCDate()); - t.is(15,date.getUTCHours()); - t.is(5,date.getMinutes()); - t.is(0,date.getSeconds()); - - rfc = "2004-02-29"; - date = dojo.date.stamp.fromISOString(rfc); - t.is(2004,date.getFullYear()); - t.is(1,date.getMonth()); - t.is(29,date.getDate()); - - rfc = "2004-01"; - date = dojo.date.stamp.fromISOString(rfc); - t.is(2004,date.getFullYear()); - t.is(0,date.getMonth()); - t.is(1,date.getDate()); - - // No TZ info means local time - rfc = "2004-02-29T01:23:45"; - date = dojo.date.stamp.fromISOString(rfc); - t.is(2004,date.getFullYear()); - t.is(1,date.getMonth()); - t.is(29,date.getDate()); - t.is(1,date.getHours()); - - date = new Date(2005,5,29,8,5,0); - rfc = dojo.date.stamp.toISOString(date); - //truncate for comparison - t.is("2005-06",rfc.substring(0,7)); - - date = new Date(101,0,2); - date.setFullYear(101); - rfc = dojo.date.stamp.toISOString(date); - //truncate for comparison - t.is("0101-01",rfc.substring(0,7)); - - rfc = "0101-01-01"; - date = dojo.date.stamp.fromISOString(rfc); - t.is(101,date.getFullYear()); - t.is(0,date.getMonth()); - t.is(1,date.getDate()); - - date = dojo.date.stamp.fromISOString("T18:46:39"); - t.is(18, date.getHours()); - t.is(46, date.getMinutes()); - t.is(39, date.getSeconds()); -}, - -function test_date_iso_tz(t){ - - //23:59:59.9942 or 235959.9942 -// var date = dojo.date.stamp.fromISOString("T18:46:39.9942"); -// t.is(18, date.getHours()); -// t.is(46, date.getMinutes()); -// t.is(39, date.getSeconds()); -// t.is(994, date.getMilliseconds()); - - //1995-02-04 24:00 = 1995-02-05 00:00 - - //timezone tests - var offset = new Date().getTimezoneOffset()/60; - date = dojo.date.stamp.fromISOString("T18:46:39+07:00"); - t.is(11, date.getUTCHours()); - - date = dojo.date.stamp.fromISOString("T18:46:39+00:00"); - t.is(18, date.getUTCHours()); - - date = dojo.date.stamp.fromISOString("T18:46:39Z"); - t.is(18, date.getUTCHours()); - - date = dojo.date.stamp.fromISOString("T16:46:39-07:00"); - t.is(23, date.getUTCHours()); - - //+hh:mm, +hhmm, or +hh - - //-hh:mm, -hhmm, or -hh - } - ] -); - -} |