Skip to content

Commit

Permalink
fix(kit): fix CalendarRange typing and checks otherDateText in `m…
Browse files Browse the repository at this point in the history
…apper` function (#8629)
  • Loading branch information
zhd-dm authored Aug 22, 2024
1 parent 36e9d0e commit 22bb699
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax<TuiDay>
valueChanges: Observable<TuiDayRange | null> | null,
@Inject(ChangeDetectorRef) readonly cdr: ChangeDetectorRef,
@Self() @Inject(TuiDestroyService) destroy$: TuiDestroyService,
@Inject(TUI_OTHER_DATE_TEXT) readonly otherDateText$: Observable<string>,
@Inject(TUI_OTHER_DATE_TEXT) readonly otherDateText$: Observable<string | null>,
@Inject(TUI_COMMON_ICONS) readonly icons: TuiCommonIcons,
) {
if (!valueChanges) {
Expand Down Expand Up @@ -153,18 +153,18 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax<TuiDay>
TuiDay | null,
TuiDay | null,
TuiDayLike | null,
string?,
string | null | undefined,
],
ReadonlyArray<TuiDayRangePeriod | string>
> = (items, min, max, minLength, otherDateText = '') => [
> = (items, min, max, minLength, otherDateText) => [
...items.filter(
item =>
(minLength === null ||
item.range.from.append(minLength).daySameOrBefore(item.range.to)) &&
(min === null || item.range.to.daySameOrAfter(min)) &&
(max === null || item.range.from.daySameOrBefore(max)),
),
otherDateText,
otherDateText ?? '',
];

get calculatedDisabledItemHandler(): TuiBooleanHandler<TuiDay> {
Expand Down

0 comments on commit 22bb699

Please sign in to comment.