This is a migrated thread and some comments may be shown as answers.

[Solved] How can we choose seconds?

2 Answers 82 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dino
Top achievements
Rank 1
Dino asked on 05 Jan 2012, 10:16 PM
Hello,

I was wondering/hoping if there was a way to extend the date/time picker to allow the user to edit the seconds for the time. I tried changing the format (see code below) to one that includes seconds, but nothing changes..

@model DateTime
 
@(Html.Telerik().DateTimePicker()
        .Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
        .HtmlAttributes(new { id = ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty) + "_wrapper" })      
        .Value(Model > DateTime.MinValue? Model : DateTime.Today)
   .Format(@Thread.CurrentThread.CurrentUICulture.DateTimeFormat.ShortDatePattern + " " + @Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongTimePattern)
)

Thanks!

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 06 Jan 2012, 10:32 AM
Hello Dino,

 
I have prepared a simple test project, which shows how to set the format of the DateTimePicker component to show seconds. The end-user will be able to modify the value using keyboard. I have also show in the test project, how to modify the format of the time picker. Please note that you can set the interval in minutes only.

Kind regards,
Georgi Krustev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Dino
Top achievements
Rank 1
answered on 06 Jan 2012, 05:42 PM
Works great! Thanks!
Tags
Date/Time Pickers
Asked by
Dino
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Dino
Top achievements
Rank 1
Share this question
or