Skip to content

Commit

Permalink
fix(addon-mobile): InputDateRange + MobileCalendar throw error on…
Browse files Browse the repository at this point in the history
… single date selection (#9502)
  • Loading branch information
nsbarsukov authored Oct 17, 2024
1 parent 86cd056 commit 086bda4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
TUI_FIRST_DAY,
TUI_LAST_DAY,
TuiActiveZoneDirective,
TuiDay,
TuiDayRange,
} from '@taiga-ui/cdk';
import {
TUI_ANIMATIONS_DURATION,
Expand Down Expand Up @@ -96,11 +98,14 @@ export class TuiMobileCalendarDropdownComponent {
this.keyboard.show();
}

confirm(value: any): void {
confirm(value: TuiDay | TuiDayRange | readonly TuiDay[] | null): void {
const control = this.single || this.multi || this.range;

if (control) {
control.value = value;
control.value =
this.range && value instanceof TuiDay
? new TuiDayRange(value, value)
: value;
}

this.close();
Expand Down

0 comments on commit 086bda4

Please sign in to comment.