Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 - DateRange-mask #75

Closed
nsbarsukov opened this issue Jan 25, 2023 · 0 comments · Fixed by #98
Closed

🚀 - DateRange-mask #75

nsbarsukov opened this issue Jan 25, 2023 · 0 comments · Fixed by #98
Assignees
Labels
feature New feature or request P1 This issue has high priority

Comments

@nsbarsukov
Copy link
Member

nsbarsukov commented Jan 25, 2023

Which package(s) are relevant/related to the feature request?

@maskito/kit

Description

We should create mask for InputDateRange.
In the most cases the new mask should behave in the same way as Date-mask.

Proposed API

import {Maskito} from '@maskito/core';
import {maskitoDateRangeOptionsGenerator} from '@maskito/kit';

const inputDateRange = new Maskito(
    element,
    maskitoDateRangeOptionsGenerator({
        mode: 'YMD',
        separator: '.',
        // ...
    })
)

Configurable options

mode

Possible values:

  • DMY - dd.mm.yyyy
  • MDY - mm.dd.yyyy
  • YMD - yyyy.mm.dd

Default value: DMY.

separator

Symbol for separating date-segments (days, months, years).
Default value: . (dot).

min

Accepts native Date.
Validates value ONLY when value is fully completed (after user input).
Default value: null.

max

Accepts native Date.
Validates value ONLY when value is fully completed (after user input).
Default value: null.

minLength

Accepts ??? .
Minimal length of range
Default value: null.

maxLength

Accepts ??? .
Maximal length of range
Default value: null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request P1 This issue has high priority
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant