-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
datetime alias: autofill year with currentyear #2266
Comments
Please help me to solve this issue. the Mask is not working for year 2020 when we input 20 in the date field. The mask input is dd/mm/yyyy. |
Which version of Inputmask are you using? |
i am using Version: 3.1.63. i tried with latest solution too and the issue still exists. |
Can you create a jsfiddle with an example. Does this also occur on the demo page? |
yes i can see the same issue in the demo page. |
Can you provide some more info as I cannot reproduce the problem. Which browser & os are you using? |
Internet Explorer 11 and Windows 8.1. The Input Mask version i am using is 3.1.63. The issue we faced for 2020 years, when we input 20, the mask is not auto populate with 2020. The configured Min Year is 1900 and Max is 2099 . |
I think I start to understand the issue. You mean there is no autofill for the year? What is your input? Can you give an example. |
How can I determine if the min value is 1900 and the maxvalue is 2099 that the user wants to type 2020 when he enters 20 and not 2019 or 2021, ... |
The issue seems here , previously i made a small change in the isInYearRange function comes under jquery.inputmask.date.extensions.js isInYearRange: function(chrs, minyear, maxyear) {
in the return statement so that it worked for 2019(maxyear >= enteredyear) changed to ( maxyear > enteredyear). I dont know for 2020. The Mask is not applying for 20 resulting 20yy also it is not triggering any incomplete event when it fails to do so. |
I only go forward with version 5.x. Do you have a suggestion about how I can autocomplete the year. |
can you able to share the code for auto mask complete for year 2020 in 5.x, if so it will be a great help for me. Thanks in advance. |
I am stuck with this for few days with no luck |
There is no autocomplete logic on the year. And I don't see it possible, besides a limited autocomplete based on the min, max value. Or do you have some suggestion? |
A solution would be to always suggest the current year and allow to overwrite the value. So entering 01/28/20 would show like 01/28/2020 What do you think? |
yes correct and the solution i need to be like this. |
Have a try with version 5.0.4-beta.7 |
Could you please give me an example code to use this. I was trying with version 3.x and when i tried with 5.x the autofillcompletion for datetime is not working for me. |
Hi @RobinHerbots, |
Your codepen doesn't seem to be working. |
please try |
Ok, the first case can be better but then you should specify a min value like 01/01/2019. There is still some polishing needed. But 010120 should be ok. |
https://codepen.io/robinherbots/pen/eYmoLJG |
Can this be closed? |
Hi, Regards, |
Hi Robin, I am encountering a problem here which is as follows, Thanks for your time. Edit : I checked your codepen : https://codepen.io/robinherbots/pen/eYmoLJG and same is happening there as well. Try entering 121220 in the field. Actual result : 12/12/2021 , what I am expecting : 12/12/20 with cursor on the third character of yyyy. |
You can disable this behavior by using the prefillYear option. |
See my previous comment 😁 |
Ah prefillYear is the one. Thank you so much Robin. It worked perfectly well. |
Hi @RobinHerbots |
No description provided.
The text was updated successfully, but these errors were encountered: