0

i am using time picker my code and options are given below :

var options = {timeFormat: 'h:mm p', interval: 15, maxTime: '11:45pm', startTime: '12:00', defaultTime: new Date(),dynamic: true, dropdown: true, scrollbar: true}

$('.end_time,.start_time').timepicker(options);

it is returning me the output like :

it is working fine but it starts from the current time .what i want is i want it to start from 12:00am and end to 11:45pm like teams and google calender timepicker.

like that

this is what i actually want

from my timpicker i am getting this

Hello Ananad this is what i am taliking about: enter image description here

Pankhuri
  • 25
  • 7

1 Answers1

0

var options = {timeFormat: 'h:mm p', interval: 15,minTime:"00:00am", maxTime: '11:45pm',  defaultTime: new Date(), startTime: '00:00am',dynamic: false, dropdown: true, scrollbar: true}

$('#time').timepicker(options);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.js"></script>
<input id="time" />

Does this answer's your question. I had put dynamic as false as it was arranging result in chronological order.

anand shukla
  • 666
  • 5
  • 14
  • its working all cool except one thing selcted date should be display in dropdown. on every click it is starting from start – Pankhuri Feb 26 '21 at 09:51
  • like if i am selecting 5:45 PM and again click dropdown showing me from 12:00 Am instead of this i want it to display the selected time. – Pankhuri Feb 26 '21 at 10:10
  • Check your code. Mine is working correctly when selected – anand shukla Feb 26 '21 at 10:18
  • I have uploaded the image on my question because i cant post it here .. i have selected 1:30PM but it is displaying the dropdown from the starting. – Pankhuri Feb 26 '21 at 10:47