Skip to content

Commit

Permalink
fix: import dayjs plugins from esm not directly
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKellerer committed Feb 15, 2024
1 parent dc80615 commit 203a219
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions components/src/temporal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as dayjs from 'dayjs';
import * as isoWeek from 'dayjs/plugin/isoWeek';
import * as advancedFormat from 'dayjs/plugin/advancedFormat';
import dayjs from 'dayjs/esm';
import isoWeek from 'dayjs/esm/plugin/isoWeek';
import advancedFormat from 'dayjs/esm/plugin/advancedFormat';

dayjs.extend(isoWeek);
dayjs.extend(advancedFormat);

Expand Down Expand Up @@ -95,7 +96,11 @@ export class YearMonthDay {
}

export class YearWeek {
constructor(readonly isoYearNumber: number, readonly isoWeekNumber: number, readonly cache: TemporalCache) {}
constructor(
readonly isoYearNumber: number,
readonly isoWeekNumber: number,
readonly cache: TemporalCache,
) {}

get text(): string {
return this.firstDay.dayjs.format('YYYY-WW');
Expand Down Expand Up @@ -137,7 +142,11 @@ export class YearWeek {
}

export class YearMonth {
constructor(readonly yearNumber: number, readonly monthNumber: number, readonly cache: TemporalCache) {}
constructor(
readonly yearNumber: number,
readonly monthNumber: number,
readonly cache: TemporalCache,
) {}

get text(): string {
return this.firstDay.dayjs.format('YYYY-MM');
Expand Down Expand Up @@ -172,7 +181,10 @@ export class YearMonth {
}

export class Year {
constructor(readonly year: number, readonly cache: TemporalCache) {}
constructor(
readonly year: number,
readonly cache: TemporalCache,
) {}

get text(): string {
return this.firstDay.dayjs.format('YYYY');
Expand Down

0 comments on commit 203a219

Please sign in to comment.