Hello!
I've attached a sample project to reproduce the problem.
It looks strange to me that day-of-week part of masked text-box can have a different default value depending on the other parts of mask.
I see two scenarios, which are at least explainable:
- Current day of week (i.e. Monday at the moment)
- First day of week in the list of culture-dependent enumeration ( i.e. Sunday )
What I observe in fact is that default value can vary: Fri, Mon, Sat, Sun
First of all, when you run the attached web-site, you'll see Fri010001. I've done some javascript debugging and there is a line you use to create new Date (and then store it in "bag") to be used for overall date validness checking.
JavaScript SetDate: function(maskInfo, date) {
if(date == null)
date = new Date(100, 0, 1);
// ... etc
and it yields "Fri Jan 01 100 00:00:00 GMT+0200 (FLE Standard Time)"
The point is that these lines of code are not always called. This on depends on whether FixLastDatePart function is called or not, which in turn depends on presence of specific mask-parts.
Now, if you press button with text "Bug #2" you'll see day of week changing to Mon (I've debugged this part as well and in general the reason is because today is Monday).
If you press it again, it will change to Sat.
I've also played with different masks and sometimes I got Sun (and I thinks it's OK, so I don't post this scenario)
Overall, I find it wrong that default days of week can be that much variable.
In my project and don't even change the mask and after several callbacks Mon changes to Fri (still can't reproduce this in sample project)
And from the customer perspective I think it may be confusing that the pre-filled value is Friday.
Also, if you press button "Bug #1" twice you'll get an exception. I think it's a separate bug.
C#[ArgumentOutOfRangeException: Year must be between 1 and 9999.
Parameter name: year]
Thanks!
Hello Artur,
I've reproduced this issue and forwarded it to our developers for further investigation. We will update this report once any news regarding this subject is available.