Skip to content

Commit

Permalink
fix(custom-mapper-for-sortkey-test): fix timezone dependent test
Browse files Browse the repository at this point in the history
The uses custom mapper for sortKey test was not using UTC dates so the test was off by 1 day due to my local timezone.
  • Loading branch information
Corey Earwood committed Sep 15, 2020
1 parent 9fba2cc commit 34cc3de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/models/model-with-custom-mapper-for-sort-key.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export class CustomId {
}

static unparse(customId: CustomId): string {
const yyyy = customId.date.getFullYear()
const mm = (<any>(customId.date.getMonth() + 1).toString()).padStart(2, '0')
const dd = (<any>customId.date.getDate().toString()).padStart(2, '0')
const yyyy = customId.date.getUTCFullYear()
const mm = (<any>(customId.date.getUTCMonth() + 1).toString()).padStart(2, '0')
const dd = (<any>customId.date.getUTCDate().toString()).padStart(2, '0')
return `${yyyy}${mm}${dd}${(<any>customId.id.toString()).padStart(CustomId.MULTIPLIER_E, '0')}`
}

Expand Down

0 comments on commit 34cc3de

Please sign in to comment.