Skip to content

Commit

Permalink
Fixes tests for timezone format
Browse files Browse the repository at this point in the history
  • Loading branch information
lamweili committed Jan 10, 2022
1 parent 6e262ae commit 289bf73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/date_format-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ describe('date_format', function() {

// when tz offset is in the pattern, the date should be in local time
dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, tzDate)
.should.eql('2010-01-11T14:31:30.005+1100');
.should.eql('2010-01-11T14:31:30.005+11:00');

tzDate = createFixedDate();
tzDate.getTimezoneOffset = function () {
return 120;
};

dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, tzDate)
.should.eql('2010-01-11T14:31:30.005-0200');
.should.eql('2010-01-11T14:31:30.005-02:00');
});

it('should provide a just-the-time format', function() {
Expand All @@ -56,6 +56,6 @@ describe('date_format', function() {
return 120;
};

dateFormat.asString('O.SSS.ss.mm.hh.dd.MM.yy', customDate).should.eql('-0200.005.30.31.14.11.01.10');
dateFormat.asString('O.SSS.ss.mm.hh.dd.MM.yy', customDate).should.eql('-02:00.005.30.31.14.11.01.10');
});
});

0 comments on commit 289bf73

Please sign in to comment.