Skip to content

Commit d36d533

Browse files
committed
Handle Moment Y year token in format conversion
1 parent 787ac80 commit d36d533

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • components/dash-core-components/src/utils/calendar

components/dash-core-components/src/utils/calendar/helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function convertFormatTokens(momentFormat: string): string {
3535
.replace(/Do/g, 'do') // Ordinal day: 1st, 2nd, 3rd
3636
.replace(/YYYY/g, 'yyyy') // 4-digit year
3737
.replace(/YY/g, 'yy') // 2-digit year
38+
.replace(/Y/g, 'y') // Year (numeric, variable length)
3839
.replace(/DD/g, 'dd') // Day of month with leading zero
3940
.replace(/D/g, 'd') // Day of month
4041
.replace(/X/g, 't'); // Unix timestamp (seconds)

0 commit comments

Comments
 (0)