24 Hour Bug - Hour Attribute

Nov 9, 2009 at 12:35 AM

<MKB:TimeSelector ID="mkbStartTimeFilter" runat="server" DisplaySeconds="false"
                SelectedTimeFormat="TwentyFour" Hour=6 Minute=0 MinuteIncrement="5"/>  

This will display 18:00 instead of 06:00

 

Coordinator
Feb 3, 2010 at 4:05 AM

Ack. Not good..... will have to look into that....

 

Feb 6, 2010 at 1:11 AM

Hi,

Have you had a chance to look into this? Do you have a workaround for this?

Thank you!

Mar 30, 2010 at 3:56 PM

From what I found and seems to have fixed it for me, is the fact that if the control is in '24' hour mode, the ampm attribute is not created, therefore when LoadPostData() executes, since it's not found, it defaults to PM.  I added the following change and has been working fine so far.

// If missing, should be in 24 hour
            string sAmPm = values[this.UniqueID + "_txtAmPm"];
            if (!String.IsNullOrEmpty(sAmPm))
            {
                AmPmSpec tAmPm = (values[this.UniqueID + "_txtAmPm"] == "AM") ? AmPmSpec.AM : AmPmSpec.PM;
                if (tAmPm != AmPm)
                {
                    AmPm = tAmPm;
                    hasAmPmChange = true;
                }
            }
            else
            {
                if (int.Parse(sHour) > 11)
                {
                    AmPm = AmPmSpec.PM;
                }
                else
                {
                    AmPm = AmPmSpec.AM;
                }
            }

 

 

 

 

Coordinator
May 24, 2010 at 6:46 PM
Edited May 24, 2010 at 7:40 PM

Fixed! Thnx for the snippet.. implemented line for line...