Alias with datetime and long months is not working properly
I'm not sure if this is a bug or if I am missing something.
I have a simple mask with the following options.
picker.inputMask = new Inputmask({
alias: "datetime",
inputFormat: "dd.mmmm.yyyy"
});
picker.inputMask.mask(picker.altInput);
The input is rendered as following
For some reason, the year part is lost completely, and the month part is moved from the center to the far right. Notice the dots in the middle. Does anyone know what might be wrong here?
User version: 5.0.9-beta.35
@stsrki ,
The problem is like
Not yet implemented :)
Any change it could be done in a timely manner?
Ps. Would you be interested in working on contractor basis for this, and any future requests?
@stsrki,
Working on contract basis is not that simple as just saying yes, .... a donation can change priorities ;-)
Anyway, I did a first attempt for the implementation. Can you have a try. You need to take the file from the dist folder.
a donation can change priorities ;-)
Will do :)
Anyways. There are still some issue.
- The long month with the format
mmmm/dd/yyyyis fully broken. See an image. There are some extra tokens in the middle of the mask - The short format,
mmm/dd/yyyyworks for all month names except for thedec. I cannot write it.
#2394
- Writing
decnow works. But there is now a problem when we try to enter an invalid value. To reproduce just writejanand then4.
- Regarding the long format,
mmmm/dd/yyyy. It still shows the wrong mask.
Also see #2277
@stsrki , Can you have a try with v5.0.9-beta.45.
I've tried v5.0.9-beta.45, but unfortunately, the same errors are still happening.
Can you remove the placeholder property and try the long datetime mmmm/dd/yyyy
I didn't tested the first issue yet. I will have a look at that too.
Without the placeholder, it looks like this
Are you sure you are using the latest version? Can you create a codepen or fiddle.
Yes, I have downloaded the latest version. Also, I cleared the cache to make sure the latest files are being used.
Can you create a codepen or fiddle.
Give me some time to do so.
Directly try with 5.0.9-beta.46, this fixes the first issue.
Can confirm the first issue is now fixed 🎉
Hello @RobinHerbots
Since this is the continuation of the same feature, I don't think there is a need to open a new issue.
Input masks now mostly work, except for the long formats. However, the main issue that we got reported by the users is that the edit mask is case-sensitive.
For example:
Works if you type in for 7th July 1967,
07 Jul 1967
or
7 Jul 1967
But not
07 JUL 1967
or 07 jul 1967
Seems the month name is case-sensitive.
it's hard to get the user to type Jul in the correct case (capital J, lowercase ul).
PS. the contractor offer is still open if you're willing to do so. Otherwise, donations are also OK but it gets complicated when paying with the company.
@stsrki,
Strange, using inputFormat: dd mmm yyyy seems to accept Jul jul JUL even jUL JuL, ... UX wise this is not good, should I force it to lowercase? whatever you type?
For the long datetime format, I know exactly what is the problem, but I still need to find the time to figure, how to deal with that.
Well, from the regular user perspective, they should not bother with writing the exact title-cased names. So making it case-insensitive would be the best way forward. To have it accept any value, Jul jul JUL, etc.
Hi @stsrki ,
I did some fixes for the long date format.
Can you have a try with the latest beta.
Best regards, Robin
Hello, sorry for not responding sooner. I was out of the town.
Anyway, I tried the new version, and I don't think it still works. Here are my observations. (Image for context)
- The long-date mask is still invalid. Notice the
/ry/in the mask - After I type the month name, it changes to an invalid name.
Februa0y - For some reason, it now shows an input mask below the input. Is this for debugging purposes?
- There are a lot of console logs(see image)
Grr, I forgot to remove the console .log ;-)
Ok I tested with dd mmmm yyyy, there it should work ok, when using mmmm dd yyyy indeed I see the problem.
@stsrki ,
Tadaa, another attempt v5.0.9-beta.53
Unfortunately, I still see the same problem 😅
The mask is mmmm/dd/yyyy.
Can you have a try with this codepen.
https://codepen.io/robinherbots/pen/VwNbmNP
Btw when using the colormask.js, you also need to include the colormask.css (and it is still experimental, .... awaiting some feedback, from someone, ...)
The codepen seems to work.
Btw when using the colormask.js, you also need to include the colormask.css (and it is still experimental, .... awaiting some feedback, from someone, ...)
Is this why the text shows bellow the input? I can review it, just let me know the details.
- How to enabled/disable it?
- Can I control the colors?
- anything else I need to know?
@stsrki , For the color mask we can best continue on #2310.
The codepen is working so I can conclude this issue is fixed?
Maybe not just yet. While the codepen works it is really basic example so I went to see what is different from my code. With only inputFormat it works. But when I also assign the placeholder then it doesn't work.
Just use this on codepen and you will see it:
Inputmask("datetime", {
inputFormat: "mmmm/dd/yyyy",
placeholder: "mmmm/dd/yyyy",
}).mask("input");
Yes, true. To be able to handle the dynamic length in the long date format the placeholder is generated based on the inputformat, but this only happens when not providing a placeholder of your own. The best approach will be ignoring the provided placeholder in this case.
Or is there a case for a custom input placeholder in the datetime alias? I will currently ignore when using the long date format.
In our project, developers can define the placeholders as they wish. So there is a need for it to work along with inputFormat.