Skip to content

Commit

Permalink
fixed tests for other timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaWise committed Feb 1, 2024
1 parent 845832c commit d84b077
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions test/local-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ describe('LocalDate', function () {
expect(new LocalDate(new LocalDate(new LocalDate(new LocalDate()))).toString()).to.equal(new LocalDate().toString())
expect(new LocalDate(new LocalDate(new LocalDate(new LocalDate(new LocalDate())))).toString()).to.equal(new LocalDate().toString())
expect(new LocalDate(new LocalDate(new LocalDate(new LocalDate(new LocalDate(new LocalDate()))))).toString()).to.equal(new LocalDate().toString())
expect(new Date(new LocalDate(new Date(1999, 2, 24, 0, 0, 0, 0))).valueOf()).to.equal(922287600000);
expect(new Date(new LocalDate(new Date(1999, 2, 24, 23, 59, 59, 999))).valueOf()).to.equal(922287600000);
expect(new Date(new LocalDate(new Date(1999, 2, 24, 0, 0, 0, 0))).valueOf()).to.equal(
new Date(new LocalDate(new Date(1999, 2, 24, 23, 59, 59, 999))).valueOf()
);
});
specify('stress test', function () {
this.slow(5000);
Expand Down
2 changes: 1 addition & 1 deletion test/offset-date-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { expect } = require('chai');
const { OffsetDateTime } = require('..');

const OFFSET = new Date().getTimezoneOffset();
const SUFFIX = (
const SUFFIX = OFFSET === 0 ? 'Z' : (
(OFFSET > 0 ? '-' : '+')
+ Math.trunc(OFFSET / 60).toString().padStart(2, '0') + ':'
+ (OFFSET % 60).toString().padStart(2, '0')
Expand Down

0 comments on commit d84b077

Please sign in to comment.