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

🚀 - MaskitoDateMode supports dd/mm & mm/dd formats #1827

Open
avtarnanrey opened this issue Nov 9, 2024 · 1 comment
Open

🚀 - MaskitoDateMode supports dd/mm & mm/dd formats #1827

avtarnanrey opened this issue Nov 9, 2024 · 1 comment
Labels
contributions welcome Architecture is clear and community can help feature New feature or request P3 This issue has low priority scope: kit Related to @maskito/kit

Comments

@avtarnanrey
Copy link

avtarnanrey commented Nov 9, 2024

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

@maskito/kit

Description

maskitoDateOptionsGenerator function do not allow dd/mm and mm/dd date formats.

Because function createMinMaxDatePostprocessor has default min date set to new Date('0001-01-01')
If user don't input year then clamp function set the date to min date and return 12/31.

To allow this, we can remove the DEFAULT_MIN_DATE from min parameter in function createMinMaxDatePostprocessor.

and then return a date if min is undefined
const clampedDate = min ? clamp(date, min, max) : date;

const clampedDate = clamp(date, min, max);

@avtarnanrey avtarnanrey added the feature New feature or request label Nov 9, 2024
@avtarnanrey avtarnanrey changed the title 🚀 - Update MaskitoDateMode types to accept dd/mm and mm/dd 🚀 - Please add support dates without year: dd/mm and mm/dd date types Nov 9, 2024
@nsbarsukov nsbarsukov changed the title 🚀 - Please add support dates without year: dd/mm and mm/dd date types 🚀 - MaskitoDateMode supports dd/mm & mm/dd formats Nov 11, 2024
@nsbarsukov
Copy link
Member

export type MaskitoDateMode =
| 'dd/mm/yyyy'
| 'mm/dd/yyyy'
| 'mm/yy'
| 'mm/yyyy'
| 'yyyy'
| 'yyyy/mm'
| 'yyyy/mm/dd';

@nsbarsukov nsbarsukov added P3 This issue has low priority scope: kit Related to @maskito/kit contributions welcome Architecture is clear and community can help labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome Architecture is clear and community can help feature New feature or request P3 This issue has low priority scope: kit Related to @maskito/kit
Projects
None yet
Development

No branches or pull requests

2 participants