Inputmask: incorrect work min max date

Created on 20 Sep 2018  路  2Comments  路  Source: RobinHerbots/Inputmask

I have this code

    var today = new Date(),
    dd = today.getDate(),
    mm = today.getMonth()+1,
    yyyy = today.getFullYear();

    if(dd<10){ dd='0'+dd; }
    if(mm<10){ mm='0'+mm; }

    var maxDate = dd+'/'+mm+'/'+yyyy;

    $("input[name='validate-birthday']").inputmask({
        alias: "datetime",
        inputFormat: "dd/mm/yyyy",
        placeholder:  '_' ,
        showMaskOnHover: false,
        min: "01/01/1918",
        max: maxDate
    });

When I try to enter a date, if the day or month is larger than the maxDate, I can not enter the year over 1999 and if the min parameter is not specified, it does not allow to enter numbers more than specified in max.
https://jsfiddle.net/qa7425b6/8/

Most helpful comment

@kost1k , @Ineigo,

https://jsfiddle.net/qa7425b6/16/
I pushed a fix. See updated jsfiddle.

Can you have a test

All 2 comments

@kost1k , @Ineigo,

https://jsfiddle.net/qa7425b6/16/
I pushed a fix. See updated jsfiddle.

Can you have a test

Thx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ErikPham picture ErikPham  路  5Comments

drolsen picture drolsen  路  3Comments

RipDevil picture RipDevil  路  5Comments

JosephWJMaxwell picture JosephWJMaxwell  路  7Comments

poornib55 picture poornib55  路  6Comments