Skip to content

Commit d3585c1

Browse files
committed
fixing typing issue caused by microsoft/TypeScript#35865
1 parent f0eaf5b commit d3585c1

7 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎projects/novo-elements/src/elements/agenda/pipe/DayOfMonth.pipe.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core';
33
@Pipe({ name: 'dayofmonth' })
44
export class DayOfMonthPipe implements PipeTransform {
55
constructor(@Inject(LOCALE_ID) private locale: string = 'en-US') {}
6-
transform(date: Date, locale: string = this.locale, method: string = 'numeric'): string {
6+
transform(date: Date, locale: string = this.locale, method: 'numeric' | '2-digit' = 'numeric'): string {
77
return new Intl.DateTimeFormat(locale, { day: method }).format(date);
88
}
99
}

‎projects/novo-elements/src/elements/agenda/pipe/EndOfWeekDisplayPipe.pipe.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core';
44
export class EndOfWeekDisplayPipe implements PipeTransform {
55
constructor(@Inject(LOCALE_ID) private locale: string = 'en-US') {}
66

7-
transform(endOfWeek: Date, startOfWeek: Date, locale: string = this.locale, method: string = 'short'): String {
7+
transform(endOfWeek: Date, startOfWeek: Date, locale: string = this.locale, method: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' = 'short'): String {
88
if (endOfWeek.getMonth() === startOfWeek.getMonth()) {
99
return new Intl.DateTimeFormat(locale, { day: 'numeric' }).format(endOfWeek);
1010
}

‎projects/novo-elements/src/elements/agenda/pipe/Hours.pipe.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core';
33
@Pipe({ name: 'hours' })
44
export class HoursPipe implements PipeTransform {
55
constructor(@Inject(LOCALE_ID) private locale: string = 'en-US') {}
6-
transform(date: Date, locale: string = this.locale, method: string = 'numeric'): string {
6+
transform(date: Date, locale: string = this.locale, method: 'numeric' | '2-digit' = 'numeric'): string {
77
return new Intl.DateTimeFormat(locale, { hour: method }).format(date);
88
}
99
}

‎projects/novo-elements/src/elements/agenda/pipe/Month.pipe.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core';
33
@Pipe({ name: 'month' })
44
export class MonthPipe implements PipeTransform {
55
constructor(@Inject(LOCALE_ID) private locale: string = 'en-US') {}
6-
transform(date: Date, locale: string = this.locale, method: string = 'long'): string {
6+
transform(date: Date, locale: string = this.locale, method: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' = 'long'): string {
77
return new Intl.DateTimeFormat(locale, { month: method }).format(date);
88
}
99
}

‎projects/novo-elements/src/elements/agenda/pipe/MonthDay.pipe.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core';
33
@Pipe({ name: 'monthday' })
44
export class MonthDayPipe implements PipeTransform {
55
constructor(@Inject(LOCALE_ID) private locale: string = 'en-US') {}
6-
transform(date: Date, locale: string = this.locale, method: string = 'short'): string {
6+
transform(date: Date, locale: string = this.locale, method: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' = 'short'): string {
77
return new Intl.DateTimeFormat(locale, { month: method, day: 'numeric' }).format(date);
88
}
99
}

‎projects/novo-elements/src/elements/agenda/pipe/Weekday.pipe.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core';
33
@Pipe({ name: 'weekday' })
44
export class WeekdayPipe implements PipeTransform {
55
constructor(@Inject(LOCALE_ID) private locale: string = 'en-US') {}
6-
transform(date: Date, locale: string = this.locale, method: string = 'short'): string {
6+
transform(date: Date, locale: string = this.locale, method: 'long' | 'short' | 'narrow' = 'short'): string {
77
return new Intl.DateTimeFormat(locale, { weekday: method }).format(date);
88
}
99
}

‎projects/novo-elements/src/elements/agenda/pipe/Year.pipe.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core';
33
@Pipe({ name: 'year' })
44
export class YearPipe implements PipeTransform {
55
constructor(@Inject(LOCALE_ID) private locale: string = 'en-US') {}
6-
transform(date: Date, locale: string = this.locale, method: string = 'numeric'): string {
6+
transform(date: Date, locale: string = this.locale, method: 'numeric' | '2-digit' = 'numeric'): string {
77
return new Intl.DateTimeFormat(locale, { year: method }).format(date);
88
}
99
}

0 commit comments

Comments
 (0)