Set Minutes in date picker

  • 18 January 2018
  • 7 replies
  • 40 views

Badge +1

Hi everyone,

How can i set the date picker to any date, any hour and only 00 or 30 (zero minutes or 30 minutes) ?


7 replies

Userlevel 4
Badge +12

There may be a solution via jquery code but as I'm not a developer last time I needed such functionality I helped me with the following approach:

  • have a date/time column in your list
  • just put a date picker not connected to your column onto the form.
  • put a choice field for hours 0 to 23 next to it
  • put a choice field for minutes 0 and 30 next to the hour choice field

Now the magic is to combine those fragments to the full date and safe it to your column.

You can do so by having a formula field on your form that combines everything to a date and is connected to your column or read those fragments within a workflow and save it.

Would that be helpful?

Best regards

Enrico

Userlevel 5
Badge +14

with jQuery you could do it eg. following way.

configure a class for datetime control, eg. OnlyHalfHour

add following code to form's custom javascript

NWF.FormFiller.Events.RegisterAfterReady(function (){
    NWF$('.OnlyHalfHour select.nf-datepicker-select:not(.nf-hours) :not(option[value="00"], option[value="30"])').remove(); 
})
Badge +1

Thank you Marian. We are going to try this solution

Badge

Hello, Marian. I'm trying use your solution , but I got problem that is i can't select hour (nothing in the dropdown ) .

so what I miss ?

Best regards!

Jayson

Userlevel 5
Badge +14

I'm not sure ....

have you retyped the code exactly as provided above (with all spaces, comas, etc.)?

have you configured a class for date control?

were you applying the script on minute's or hour's dropdown?

any errors on developer console?

what platform and version are you on?

Badge +11

Did you find a solution ? I'm looking for the same  set date picker to 30 minutes interval. Any help would be appreciated

Badge +11

Did you get it to work?

Reply