SM_TimeEntry is a custom Flex controls that allows a user to quickly and easily enter a valid time into your applications. It supports multiple styling options, text sizing, 12 and 24 hour format, and keyboard interaction too.
I think this is a great component, but I have found a small bug in it. When you are using it in 12-hour and you set the hour, minute and am_pm variables, the time displays "0:00:00 am". The minute actually does display correctly.
For example, I am populating the component with the current system time. So, if the system time is 12:15 am, and I set the hour, minute and am_pm properties appropriately, the time displayed in the component shows 0:15:am.
I tried using your example webpage that shows how the component works. The 2 12-hour examples displayed the same bug.
I've had your zip on my desks for months because I knew that sooner or later I'd need it. Sure nuff, I needed a component that would give me both date and time. I added month, day, and year to it by following your code and voila! Way cool, thank you. Now, I'm making another one that does IP addresses -- just in case.
minute and am_pm variables, the time displays "0:00:00 am". The minute actually does display correctly.
For example, I am populating the component with the current system time. So, if the system time is 12:15 am, and I set the
hour, minute and am_pm properties appropriately, the time displayed in the component shows 0:15:am.
I tried using your example webpage that shows how the component works. The 2 12-hour examples displayed the same bug.
if(theField == 'hourText' && !is24Hour)
{
return value;
}
should be...
if(theField == 'hourText' && !is24Hour)
{
if(value == "0") { value = "12"; }
return value;
}
The default display for 12-hour time fields will then be 12:00 am instead of 0:00 am.