CodePlex Home
Register
|
Sign In
|
CodePlex Home
Home
Downloads
Issue Tracker
Source Code
People
License
Close
RSS
All Project Updates
Issue Tracker
Releases
Reviews
Source Code
Wiki & Documentation
RSS
Basic View
|
Advanced View
|
Create New Item
Item
1
of
1
Previous
|
Next
2
votes
closed
If I do not set AcceptAMPM to true always get invalid time
Description
File Attachments
MaskedEditValidator.cs
07-06-25.18-05.PatchFor23894.zip
Closed
Jul 6 2007 at 12:38 AM
by
AjaxTK
Comments
most recent at top
(
show oldest at top
)
wrote
Jul 6 2007 at 12:38 AM
Resolved with changeset 24400.
wrote
Jun 30 2007 at 2:55 AM
Assigning to AjaxTK and changing release to be the next one.
shawnburke
wrote
Jun 26 2007 at 7:12 AM
Thank you! We'll take a look.
gmorgan
wrote
Jun 25 2007 at 9:09 AM
Attaching patch for this issue created with the Ajax Control Toolkit Patch Utility....
gmorgan
wrote
Jun 25 2007 at 7:59 AM
There is a bug in the MaskedEditValidator's EvaluateIsValid() function when 24hr format is used (AcceptAMPM=false). The if statement at line 602 does not take into consideration the AcceptAMPM property, so the AMPM text (which isn't present) is always subtracted from the length used to compare against the time value's length. Adding a check for this property in the if statement solves the problem.
I have modified my MaskedEditValidator class as follows (at line 602):
int tamtext = Target.Text.Length;
if (MaskExt.AcceptAMPM &&
!string.IsNullOrEmpty(CultureAMPMP) &&
(MaskExt.MaskType == MaskedEditType.Time || MaskExt.MaskType == MaskedEditType.DateTime))
{
char[] charSeparators = new char[] { ';' };
string[] ArrAMPM = CultureAMPMP.Split(charSeparators);
if (ArrAMPM[0].Length != 0)
{
tamtext -= (ArrAMPM[0].Length + 1);
}
}
if (MaskedEditCommon.GetValidMask(MaskExt.Mask).Length != tamtext)
{
ok = false;
}
The modified class file is attached. Is it possible to get this modification included in the next release?
Sign in to add a comment
Comment:
Work Item Details
Item #
10902
Status
Closed
Type
Issue
Impact
Medium
Release
10920
Assigned To
AjaxTK
Component
MaskedEdit
Reported On
Jun 8 2007 at 1:41 AM
Reported By
kirtid
Updated On
Jul 6 2007 at 12:38 AM
Updated By
AjaxTK
Closed On
Jul 6 2007 at 12:38 AM
Closed By
AjaxTK
Wiki Link
[workitem:10902]
Updating...
© 2006-2009 Microsoft
|
About CodePlex
|
Privacy Statement
|
Terms of Use
|
Code of Conduct
|
Advertise With Us
|
Version 2009.10.27.15987