RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.39k stars 2.17k forks source link

Inputmask datetime alias mm/yy min value bug #2744

Closed ldkafka closed 6 months ago

ldkafka commented 1 year ago

The datetime alias with an inputFormat of mm/dd does not accept input with 'min' constrains - version 5.0.8.

The following code reproduces the issue in the latest versions of Chrome and Firefox on Windows 11. If the 'min' argument is removed, the plugin works as expected and it enforces the 'max' constrain'.

<!DOCTYPE html>
<html lang="en-US">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/5.0.8/jquery.inputmask.min.js"></script>
</head>
<body>
<form>
    <input type="text" id="creditcard-expiry" name="CreditCard[expiry]" aria-required="true"><label class="form-label" for="creditcard-expiry"><i class="bi bi-calendar4-event"></i> Expiry date</label>
</form>

<script>
window.onload = function () {
    jQuery("#creditcard-expiry").inputmask( {"alias":"datetime","inputFormat":"mm/yy","min":"10/23","max":"10/33"});
};
</script>
</body>
</html>
RobinHerbots commented 6 months ago

@ldkafka ,

The parsing issue for yy yearformat is fixed.

Have a try with version 5.0.9-beta.58