Bootstrap-datetimePicker sets seconds, simple and rude

Find the following code location, my js is around 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();

Change the last line to data 0~59 to be written to death

 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();

Finish! Every time you select time seconds, it becomes a dead time

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324731394&siteId=291194637