Bootstrap-datetimePicker设置秒,简单粗暴

查找到下面代码位置,我的js在1073左右

 case 'span':
       if (!target.is('.disabled')) {
           var year = this.viewDate.getUTCFullYear(),
             month = this.viewDate.getUTCMonth(),
             day = this.viewDate.getUTCDate(),
             hours = this.viewDate.getUTCHours(),
             minutes = this.viewDate.getUTCMinutes(),
             seconds = this.viewDate.getUTCSeconds();

将最后一行改为要写死的数据0~59

 case 'span':
       if (!target.is('.disabled')) {
         var year = this.viewDate.getUTCFullYear(),
           month = this.viewDate.getUTCMonth(),
           day = this.viewDate.getUTCDate(),
           hours = this.viewDate.getUTCHours(),
           minutes = this.viewDate.getUTCMinutes(),
           seconds = 0;
          // seconds = this.viewDate.getUTCSeconds();

完成!每次选择时间秒则变为写死的时间

猜你喜欢

转载自blog.csdn.net/qq_36430463/article/details/80052004
今日推荐