From 76ff7aa5fa0c14064bf3cdfe1a1eb5fe752641c5 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Mon, 8 Jul 2013 08:51:42 +1000 Subject: [PATCH] improved coverage of date format --- test/date_format-test.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/date_format-test.js b/test/date_format-test.js index 5026991..d4a5cb5 100644 --- a/test/date_format-test.js +++ b/test/date_format-test.js @@ -20,15 +20,20 @@ vows.describe('date_format').addBatch({ '2010-01-11 14:31:30.005' ); }, -/* this test will only pass in Australia (GMT+11) - javascript doesn't - provide a way to change or specify a Date's timezone 'should provide a ISO8601 with timezone offset format': function(date) { + date.getTimezoneOffset = function() { return -660; }; assert.equal( dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, date), "2010-01-11T14:31:30+1100" ); + + date.getTimezoneOffset = function() { return 120; }; + assert.equal( + dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, date), + "2010-01-11T14:31:30-0200" + ); + }, -*/ 'should provide a just-the-time format': function(date) { assert.equal( dateFormat.asString(dateFormat.ABSOLUTETIME_FORMAT, date),