Cleave.js: Feature Req - Max Date Rage

Created on 28 Jun 2018  路  5Comments  路  Source: nosir/cleave.js

Thanks for this awesome library!

Is there any possibility of adding a limit on the date range that is valid? Specifically, I don't want to be able to set a year like 12/31/9999. It would be great to validate that the year is within some bounds.

Most helpful comment

There's a bug when min is not added. I get a cannot read property split from undefined could we have min as an optional value?

All 5 comments

Thanks for the like.
I guess the difficult part here is, when one sets a max date: 2019-10-31, and as soon as the user types 2019-11, the lib shall detect that and revise the value to 2019-10
I will have a look

Maybe the ideal behaviour for the range implementation would be similar to that used when trying to type 31 days for a month with 30, or 29 days for February on a non leap year, that is, replace for the maximum/minimum as soon as a date outside the range is typed.

There's a bug when min is not added. I get a cannot read property split from undefined could we have min as an optional value?

@humodev that issue has been fixed and released in v1.5.2. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ozkxr picture ozkxr  路  3Comments

melbon picture melbon  路  3Comments

CaptainYarb picture CaptainYarb  路  3Comments

shaileshrathod128 picture shaileshrathod128  路  6Comments

ArtyomBist picture ArtyomBist  路  6Comments