Tuesday, October 29, 2019

Time show in drop down using jquery


                 <input type="text" id="time_get" class="time_get" name="time_get" placeholder="Choose Time Slot">
              <script>
  $(document).ready(function(){
   var time = new Date();
 var current_time_ab = time.toLocaleString('en-US', { hour: 'numeric', hour12: true });
   $('.time_get').timepicker({
    timeFormat: 'hh p',
    interval: 60,
    minTime: current_time_ab,
    maxTime: '6:00pm',
    defaultTime: 'Choose Time Slot',
    startTime: current_time_ab,
    dynamic: false,
    dropdown: true,
    scrollbar: true
});
});

  </script>
  <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.js"></script>

No comments:

Post a Comment