Skip to content

Commit 34cc3de

Browse files
author
Corey Earwood
committed
fix(custom-mapper-for-sortkey-test): fix timezone dependent test
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.
1 parent 9fba2cc commit 34cc3de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/models/model-with-custom-mapper-for-sort-key.model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ export class CustomId {
2020
}
2121

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

0 commit comments

Comments
 (0)