generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kit):
Date
-mask fix wrong year that appears using the min prope…
…rty (#157)
- Loading branch information
1 parent
0815b8e
commit 544e891
Showing
9 changed files
with
99 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
projects/demo/src/pages/kit/date/examples/1-localization/component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {ChangeDetectionStrategy, Component} from '@angular/core'; | ||
|
||
import mask from './mask'; | ||
|
||
@Component({ | ||
selector: 'date-mask-doc-example-1', | ||
template: ` | ||
<tui-input | ||
tuiTextfieldCustomContent="tuiIconCalendarLarge" | ||
[tuiTextfieldFiller]="filler" | ||
[style.max-width.rem]="30" | ||
[(ngModel)]="value" | ||
> | ||
Localization | ||
<input | ||
tuiTextfield | ||
inputmode="decimal" | ||
[maskito]="mask" | ||
/> | ||
</tui-input> | ||
`, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class DateMaskDocExample1 { | ||
value = '2005/10/21'; | ||
readonly filler = 'yyyy/mm/dd'; | ||
readonly mask = mask; | ||
} |
3 changes: 3 additions & 0 deletions
3
projects/demo/src/pages/kit/date/examples/1-localization/mask.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import {maskitoDateOptionsGenerator} from '@maskito/kit'; | ||
|
||
export default maskitoDateOptionsGenerator({mode: 'yyyy/mm/dd', separator: '/'}); |
28 changes: 28 additions & 0 deletions
28
projects/demo/src/pages/kit/date/examples/2-min-max/component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {ChangeDetectionStrategy, Component} from '@angular/core'; | ||
|
||
import mask from './mask'; | ||
|
||
@Component({ | ||
selector: 'date-mask-doc-example-2', | ||
template: ` | ||
<tui-input | ||
tuiTextfieldCustomContent="tuiIconCalendarLarge" | ||
[tuiTextfieldFiller]="filler" | ||
[style.max-width.rem]="30" | ||
[(ngModel)]="value" | ||
> | ||
Date | ||
<input | ||
tuiTextfield | ||
inputmode="decimal" | ||
[maskito]="mask" | ||
/> | ||
</tui-input> | ||
`, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class DateMaskDocExample2 { | ||
value = '20.01.2023'; | ||
readonly filler = 'dd.mm.yyyy'; | ||
readonly mask = mask; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {maskitoDateOptionsGenerator} from '@maskito/kit'; | ||
|
||
export default maskitoDateOptionsGenerator({ | ||
mode: 'dd/mm/yyyy', | ||
min: new Date(2000, 0, 1), | ||
max: new Date(2025, 4, 10), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters