Skip to content

Commit

Permalink
fix(core): datepicker uses incorrect formatting tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfeldpausch committed Sep 8, 2023
1 parent 3ed918d commit 742a8b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/components/cat-datepicker/cat-datepicker.format.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CatDatepickerMode } from './cat-datepicker.mode';

export function getFormat(language: string, mode: CatDatepickerMode): string {
const date = new Date(2000, 1, 3, 4, 5, 6);
const date = new Date(2000, 1, 3, 16, 5, 6);
const formatDate: Intl.DateTimeFormatOptions = { year: 'numeric', month: '2-digit', day: '2-digit' };
const formatTime: Intl.DateTimeFormatOptions = { hour: '2-digit', minute: '2-digit' };
return mode === 'week'
Expand All @@ -20,7 +20,8 @@ export function getFormat(language: string, mode: CatDatepickerMode): string {
.replace('00', 'y')
.replace('02', 'm')
.replace('03', 'd')
.replace('04', 'H')
.replace('04', 'h')
.replace('16', 'H')
.replace('05', 'i')
.replace(/AM|PM/i, 'K');
}

0 comments on commit 742a8b0

Please sign in to comment.