This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Map deprecated timezone in shopify/dates
- Loading branch information
Showing
5 changed files
with
38 additions
and
23 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.changeset/rude-countries-tickle.md → .changeset/light-students-learn.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
'@shopify/react-i18n': patch | ||
'@shopify/dates': patch | ||
--- | ||
|
||
Map deprecated timezone |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {formatDate} from '../formatDate'; | ||
|
||
jest.mock('../../map-deprecated-timezones', () => ({ | ||
mapDeprecatedTimezones: jest.fn(), | ||
})); | ||
|
||
const mapDeprecatedTimezones: jest.Mock = jest.requireMock( | ||
'../../map-deprecated-timezones', | ||
).mapDeprecatedTimezones; | ||
|
||
describe('formatDate', () => { | ||
it('maps the deprecated timezone', () => { | ||
const date = new Date(); | ||
const locale = 'en-UA'; | ||
const options: Intl.DateTimeFormatOptions = { | ||
timeZone: 'Europe/Kyiv', | ||
}; | ||
|
||
formatDate(date, locale, options); | ||
expect(mapDeprecatedTimezones).toHaveBeenCalledWith('Europe/Kyiv'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters