Skip to content

Commit

Permalink
Merge branch 'v3.x' into splincode/avatar-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Feb 29, 2024
2 parents 18e50e6 + 14a8a8b commit ca11d98
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import {
tuiDateStreamWithTransformer,
TuiInputDateOptions,
} from '@taiga-ui/kit/tokens';
import {combineLatest, Observable, timer} from 'rxjs';
import {BehaviorSubject, combineLatest, Observable, timer} from 'rxjs';
import {map, takeUntil} from 'rxjs/operators';

@Component({
Expand All @@ -83,6 +83,7 @@ export class TuiInputDateTimeComponent
private readonly textfield?: TuiPrimitiveTextfieldComponent;

private month: TuiMonth | null = null;
private readonly timeMode$ = new BehaviorSubject<TuiTimeMode>('HH:MM');

@Input()
min: TuiDay | [TuiDay | null, TuiTime | null] | null = this.options.min;
Expand All @@ -97,7 +98,13 @@ export class TuiInputDateTimeComponent
defaultActiveYearMonth = TuiMonth.currentLocal();

@Input()
timeMode: TuiTimeMode = 'HH:MM';
set timeMode(value: TuiTimeMode) {
this.timeMode$.next(value);
}

get timeMode(): TuiTimeMode {
return this.timeMode$.value;
}

open = false;

Expand All @@ -109,8 +116,13 @@ export class TuiInputDateTimeComponent
changeDateSeparator(dateTexts[this.dateFormat], this.dateSeparator),
),
),
this.timeTexts$.pipe(map(texts => texts[this.timeMode])),
]).pipe(map(fillers => this.getDateTimeString(...fillers)));
this.timeTexts$,
this.timeMode$,
]).pipe(
map(([dateFiller, timeTexts, timeMode]) =>
this.getDateTimeString(dateFiller, timeTexts[timeMode]),
),
);

constructor(
@Optional()
Expand Down

0 comments on commit ca11d98

Please sign in to comment.