none
Bootstrap Time Picker RRS feed

  • Question

  • I am using this below :

                 

    in Cab request Tool,In which Time control(Bootstarp Time picker) not allowing user to book time 2 hours before from current time.

     $(function () {  
                    $('#pickTime').datetimepicker({
    ignoreReadonly: true,
                        format: 'LT'
                    });
                });

    I want that if user if entering time then he is not able to select till 2 hours before current time.

    That is he can select pick Time before 2 hours only from current time.Because Cab Team needs 2 hours to booking process.

    Example current time is 10:24am then user enable time is till 8:24 ,



    Shiv Sharma


    Friday, November 15, 2019 4:59 AM

All replies

  • Hi SharePoint User02,

    Bootstrap Date Time picker offers option to set the min date. You may also take a reference of the following similar issues:

    Best Regards,

    Baker Kong


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, November 15, 2019 8:15 AM
  • Can you please update in my code as per my condition. what i need to do for this senario

    Shiv Sharma

    Thursday, December 12, 2019 6:57 AM
  • Hi SharePoint User02,

    Please take a reference of following code:

    $(function () {
              var dp= $('#datetimepicker1').datetimepicker();
              dp.on('changeDate', function (e) {
                
                let mdate= new Date();
                let midate= mdate.setHours(mdate.getHours()-2);
               
                if(e.date<midate){
                  alert(`current time: ${e.date} while mindate is ${midate}`);
                }else{
                  alert(`you select good time`);
                }
              });
    
    });

    Best Regards,

    Baker Kong


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, December 13, 2019 10:17 AM