You are viewing limited content. For full access, please sign in.

Question

Question

Default Time Field to PM

asked on July 15, 2020

I am creating a telework schedule form that has a Start and End time field.  I want to default the End Time field to PM.  I tried changing the fields range to only PM times, but the field still appears with AM as default.  How can I change the End Time field to load with PM as the default?

0 0

Answer

SELECTED ANSWER
replied on July 15, 2020

Hi Vanessa,

If you want to set every time field's AM/PM to PM, you can use the following JavaScript:
 

$(document).ready(function() {
  $(".timepicker-type-dropdown").val("pm").change();
});

Alternatively, if you only want certain ones to default to PM, apply the CSS class timepicker-pm-default to those fields and then use the following JavaScript instead:

$(document).ready(function() {
  $(".timepicker-pm-default .timepicker-type-dropdown").val("pm").change();
});

 

1 0

Replies

replied on July 15, 2020

Thank you Jim! This worked perfectly. smiley

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.