How to set time to be 11:59PM always and disable the time picker using jquery and Angular8

China☆狼群 提交于 2021-02-11 14:15:10

问题


Hi i have used Angular8+ and Jquery to bind calendar into the input field.But irrespective of time zone, i always want to show time to be 11:59PM and disable the Time Picker and set that to 11:59PM by default.

Can anyone help me how to make this work.

TS:

$(".onlyDate").datetimepicker({ format: "L" });
      let dat = null;
       $(".onlyDateTime")
      .datetimepicker()
      .on("dp.hide", e => {
        const date = e.date;
         let dat = e.date.format("L");
        this.Restrictions[this.selectedIndex].datetime = dat.format("MM/DD/YYYY 11:59 A");
      });

DEMO

来源:https://stackoverflow.com/questions/62831109/how-to-set-time-to-be-1159pm-always-and-disable-the-time-picker-using-jquery-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!