TimePicker Control

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
6/9/2011 4:28:23 AM
Gravatar
Total Posts 2

TimePicker Control

For my site I need a Time picker control.

I have been looking at the DatePickerControl and this could be easily modified to be just a time picker.

You could add a property ShowDate which when set to False and the ShowTime is set to true would only show the time selection slider.

You can then use the JQuery function 'timepicker' to show only the timeslider control. There would just need to be a change to SetupScript() int jDatePicker.js

if (showDate && showTime)
            {
                script.Append("$('#" + ClientID + "').datetimepicker(");
            }
else if (showTime)
            {
                script.Append("$('#" + ClientID + "').timepicker(");
            }
else
            {
                script.Append("$('#" + ClientID + "').datepicker(");
            }

If both showDate AND showTime were set to false the datepicker would still be displayed.

 

Alternatively the DatePickerControl could be copied and with a few small changes a separate TimePickerControl could be made.

 

6/10/2011 7:22:19 AM
Gravatar
Total Posts 18439

Re: TimePicker Control

Hi Paul,

I'll add this change to the jDatePicker with a slight variation. It doesn't feel right to show a dataepicker if showDate is false, so instead of adding a showDate property I added a showTimeOnly property, so the code is like this:

if (showTimeOnly)
  {
        script.Append("$('#" + ClientID + "').timepicker(");
   }
   else if (showTime)
   {
         script.Append("$('#" + ClientID + "').datetimepicker(");
    }
     else
    {
         script.Append("$('#" + ClientID + "').datepicker(");
     }

This will be in the source code repository later today.

Best,

Joe

6/13/2011 7:28:15 PM
Gravatar
Total Posts 2

Re: TimePicker Control

Joe,

You don't seem to have added ShowTimeOnly to the interface of the control so I cannot set the ShowTimeOnly to true.

Regards,

Paul

6/14/2011 2:55:53 PM
Gravatar
Total Posts 18439

Re: TimePicker Control

Hi Paul,

<mp:DatePickerControl is a control that wraps around a provider model to plugin different date picker implementations but each implementation should support the same things and since we do have one other date picker and it does not support time only I don't think we should add this into the provider model.

Instead I would suggest just directly use 

<portal:jDatePicker

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.