-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pci-savings-plan): add utc date on creation (#14447)
ref: TAPC-1726 Signed-off-by: Lionel Bueno <[email protected]>
- Loading branch information
1 parent
6997291
commit 5148b67
Showing
2 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
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
11 changes: 11 additions & 0 deletions
11
packages/manager/apps/pci-savings-plan/src/utils/formatter/date.ts
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 +1,12 @@ | ||
export const formatDate = (date: Date) => date.toISOString().split('T')[0]; | ||
|
||
export const toLocalDateUTC = (date: string, locale: string) => | ||
new Date(date).toLocaleString(locale.replace('_', '-'), { | ||
timeZone: 'UTC', | ||
day: 'numeric', | ||
month: 'short', | ||
year: 'numeric', | ||
hour: '2-digit', | ||
minute: '2-digit', | ||
timeZoneName: 'short', | ||
}); |