Yet Another TimePicker Update - DisplaySeconds
I had several people tell me they would find it useful if there were a way to hide the seconds of the datepicker. For this reason, I created the DisplaySeconds boolean property. It’s also included in the TimePicker documentation.
Categories: .NET TimePicker
Hi Mike,
Any chance you will be adding a .SelectedTime method? Several of the other TimePickers have this for assignment or comparison.
thanks!
Dave
Hello I’m developing an application for my current company and I would really like to use yopur timepicker
but it doesn’t works for asp.net 2.0 when I try to add it it says cannot load System.Web.Extensions and I tryed
to add the extension manually and it doesn’t exists in framework 2.0 isn’t the component compatible with 2.0 like it says in the page??
And if there’s an older version of it that you have can you please send it to me or post it somewhere so I can download it??
Best Regards
The “Date” property is actually what contains the time… the time and the date. I might have to rename this property though…
You can download an older code base from the codeplex project, which is located at http://TimePicker.Codeplex.com
Hello Michael,
I’m glad that I found your blog because I need to use a date picker in our ASP.net appplication. I already downloaded the TimePicker.dll but dont know how to use it. Please help how can use the .dll. I am a beginner programmer.
Please Mike help me
Thanks,
Wezlie
Dear Mike
I tried this step first:
Add this in my aspx page but I saw an error message saying ‘unrecognize tag prefix’
Please…
Thanks,
Wezlie
I mean added this
Thanks again,
Wezlie
”
I mean this one MKB:timeselector id=’TimeSelector1″ runat
And then this:
Imports System.Object
Imports MKB.TimePicker
Imports MKB.TimePicker.TimeSelectorAvailabilityValidator
Imports MKB.TimePicker.ButtonSettings
Dear Mike
And also when I include this code below in the General Declarations
Imports MKB.TimePicker.TimeSelector
i saw this error message
‘Indirect reference is being made to assembly System.Web.Extensions version 3.5.0.0
whicj contains MKB.TimePicker.TimeSelector…To use MKB.TimePicker.TimeSelector
….you must replace the reference to System.Web.Extensions version with version or higher3.5.0.0′
Thanks,
Wezlie
Dear Mike,
at first: Great Control! I want to use it in an application for my company but I need a little help.
If got several TimePicker-Controls on one site. It works fine, if the user clicks on one arrow-key, the hour selects and increment.Now, if you click on the arrow keys of another control the time/hour is not selected automatic and the time increment on the last selected control, not on the current one. Is there any solution for this problem.
Sorry for my bad english, I hope you understand what i mean. You can try this on your own demo-site: http://www.michaelkbell.com/TimePicker/ There occurs the same problem.
Thank you
Frank
Anyone else have this problem?
Whenever I try to parse the time, it forces the time into PM or AM regardless of its real value. If I have SelectedTimeFormat=”TwentyFour” on, it makes everything PM regardless.
So I selected 05:00:00 which should return 9/17/2009 5:00:00 AM
DateTime testB = DateTime.Parse(TimeSelector1.Date.ToShortTimeString());
Instead I get 9/17/2009 5:00:00 PM
Any ideas?
@JD
also tried these, but returned the same results..
DateTime testB = DateTime.Parse(TimeSelector1.Date.ToString());
DateTime test = DateTime.Parse(CalendarUpdate.SelectedDate.ToShortDateString() + ” ” + TimeSelector1.Hour + “:” + TimeSelector1.Minute + “:00″);
Hi Mike
Which version of AJAX we need to use this control as I am getting the following error and dont know what to do???
Assembly ‘TimePicker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d25e9f59e49c4d2f’ uses ‘System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ which has a higher version than referenced assembly ‘System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′
Hi, I am trying to use your control within an ajax updatepanel. When I attempt to change the time when I run the form, I get the following error:
“Microsoft JScript runtime error: Object Expected”
Do you have a fix for this error?
Thanks,
bob
@bob smith
I fixed my own problem! Just add a dummy hidden TimeSelector outside of the formview (but inside the same updatepanel) and set it to invisible:
Hi Mike
I have solved my above problem.
Now there is another problem with this control. When I set SelectedTimeFormat to TwentyFour and I set hour that is > 12, it adds 12 hour in Hour property and that gives me wrong Hour. Can you check it for me
Thanks
hi mike,
i tried to use your datetime picker.and i got a little issue when i was trying to use it in twenty four hour format.once i enter 1.30 it will comes as 13 in hours field.this happens when the client computer’s time is in PM.(as i guess)
i feel it’good to have a look on that issue.please !!!
Hi Michael,
Great control but am having an issue with it on a Dynamic Data Website.
It was working great in normal webforms but something isn’t happy in a Dynamic context.
I have added the control to a FieldTemplate and in Edit mode no matter what I do I cannot edit the time. The arrows dont change anything. Likewsise manually placing the cursor on hours or minutes and trying to increment / decrement by up/down arrows doesn;t do anything either…
Any ideas ?
Regards
Steve Mew
Sorry I’ve been lagging in the responses guys. Kind of busy these days. You can always grab the source from http://timepicker.codeplex.com and extend on or debug. I’d be happy to republish code if you find bugs/fixes. Sorry that I’m unableto commit time to this project right now…
Hi Michael,
I can’t manage to change the font color of the timepicker control. I tried using both stylesheets and the property of the control. No success. Can you please help me?
thanks
Aaron
FYI - I tried using the lastest download of this library but it references a library, GVSVC.DLL that I can NOT find on my windows installation (Vista 64, Server 2003).
Hi!
Well I probably fix bug with TwentyFour mode. How can update the source code for TimePicker?
Thanks Mike! I really like your timepicker. Its easy to use and priced right
I was having the same problem as Frank (focus was not changing between multiple instances of timepickers), so I took a look at the source code on codeplex. I was able to get the focus to change by making a small change in the javascript function ensureFocus - just need to update the global variable lastFocusCtrl.
function ensureFocus(c)
{
var controlSetPrefix = c.id.replace(’_imgUp’, ”);
controlSetPrefix = controlSetPrefix.replace(’_imgDown’, ”);
if (lastFocusCtrl == null) // This should only happen once, max
{
lastFocusCtrl = document.getElementById(controlSetPrefix + ‘_txtHour’);
}
else
{
if (lastFocusCtrl.id.indexOf(controlSetPrefix) != 0)
{
var elem = document.getElementById(controlSetPrefix + ‘_txtHour’)
if (null != elem)
{
elem.focus();
lastFocusCtrl = elem;
}
}
}
}
Thanks again!
Hi Mike,
Did you fixed the problem JD mentioned here.(Comment no 13, 14). I have the same problem. If we set SelectedTimeFormat=”TwentyFour” then if we choose 5:00 it returns only PM as 17:00. Could you pls fix this problem and update the DLL?
Thanks again!.
@Ilia Lukianov
Hi Ilia, could u please send the source code for fix the SelectedTimeFormat=”TwentyFour”?
Thank you Jean for posting your solution.
works great!
Hi,
relating to the TwentyFour bug - 09:00 always getting 21:00, 10:00 always
getting 22:00 and so on…
don’t know if that’s really a good solution, but it worked for me:
IMHO there was just a little piece of code missing in the date property:
///
/// DateTime value. Defaults to current day if not set. Otherwise, maintains a value of the date assigned plus time shown.
///
[Browsable(true)]
public DateTime Date
{
get
{
if (ViewState["Date"] == null)
return DateTime.MinValue;
else
{
if (SelectedTimeFormat == TimeFormat.Twelve)
{
ViewState["Date"] = Convert.ToDateTime(ViewState["Date"]).ToShortDateString() + ” ” + Hour.ToString() + “:” + Minute.ToString() + “:” + Second.ToString() + ” ” + AmPm.ToString();
}
else
{
ViewState["Date"] = Convert.ToDateTime((Convert.ToDateTime(ViewState["Date"]).ToShortDateString() + ” ” + Hour.ToString() + “:” + Minute.ToString() + “:” + Second.ToString() + ” “), System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat);
}
return Convert.ToDateTime(ViewState["Date"]);
}
}
set
{
ViewState["Date"] = value;
SetTime(value);
}
}
maybe someone can benefit from