Skip to content

Commit

Permalink
chore(kit): add Tui- prefix for interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbarsukov committed Dec 27, 2021
1 parent 2738f19 commit e0540a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ export class TuiInputDateTimeComponent
this.calendarMinDay,
this.calendarMaxDay,
this.timeMode,
this.dateFormat,
// TODO finish localization in {@link https://github.com/TinkoffCreditSystems/taiga-ui/issues/954 issue}
'DMY',
);
}

Expand Down
6 changes: 3 additions & 3 deletions projects/kit/utils/mask/create-auto-corrected-date-pipe.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {DATE_FILLER_LENGTH, TuiDateMode, TuiDay} from '@taiga-ui/cdk';
import {TuiTextMaskPipeHandler, TuiWithOptionalMinMaxWithValue} from '@taiga-ui/core';

export interface AutoCorrectedDatePipeConfigs
export interface TuiAutoCorrectedDatePipeConfigs
extends TuiWithOptionalMinMaxWithValue<TuiDay | null, TuiDay> {
dateFormat: TuiDateMode;
dateSeparator: string;
}

export function normalizeDateValue(
dateValue: string,
{value, min, max, dateFormat, dateSeparator}: AutoCorrectedDatePipeConfigs,
{value, min, max, dateFormat, dateSeparator}: TuiAutoCorrectedDatePipeConfigs,
): string {
return value && value.toString() === dateValue
? dateValue
Expand All @@ -19,7 +19,7 @@ export function normalizeDateValue(
}

export function tuiCreateAutoCorrectedDatePipe(
config: AutoCorrectedDatePipeConfigs,
config: TuiAutoCorrectedDatePipeConfigs,
): TuiTextMaskPipeHandler {
return value => {
if (value.length !== DATE_FILLER_LENGTH) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import {TuiTextMaskPipeHandler} from '@taiga-ui/core';
import {DATE_TIME_SEPARATOR} from '@taiga-ui/kit/constants';

import {
AutoCorrectedDatePipeConfigs,
normalizeDateValue,
TuiAutoCorrectedDatePipeConfigs,
} from './create-auto-corrected-date-pipe';
import {tuiCreateAutoCorrectedTimePipe} from './create-auto-corrected-time-pipe';

interface AutoCorrectedDateTimePipeConfigs extends AutoCorrectedDatePipeConfigs {
interface TuiAutoCorrectedDateTimePipeConfigs extends TuiAutoCorrectedDatePipeConfigs {
timeMode: TuiTimeMode;
}

export function tuiCreateAutoCorrectedDateTimePipe(
configs: AutoCorrectedDateTimePipeConfigs,
configs: TuiAutoCorrectedDateTimePipeConfigs,
): TuiTextMaskPipeHandler {
const timePipe = tuiCreateAutoCorrectedTimePipe(configs.timeMode);

Expand Down

0 comments on commit e0540a7

Please sign in to comment.