quickTimeSelectiondays if days = 1 const end = new Date const start = new Date thisparamsendTime = dateFormatendsetTimeendgetTime yyyy-MM-dd HHmmss thisparamsstartTi
quickTimeSelection(days) { if (days >= 1) { const end = new Date() const start = new Date() this.params.endTime = dateFormat(end.setTime(end.getTime()), 'yyyy-MM-dd HH:mm:ss') this.params.startTime = dateFormat(start.setTime(start.getTime() - (days * 24 * 3600 * 1000)), 'yyyy-MM-dd HH:mm:ss') } else { this.params.endTime = '' this.params.startTime = '' } if (days === -4) { console.log() this.params.endTime = this.dateTime ? dateFormat(this.dateTime[1], 'yyyy-MM-dd HH:mm:ss') : '' this.params.startTime = this.dateTime ? dateFormat(this.dateTime[0], 'yyyy-MM-dd HH:mm:ss') : '' }
原文地址: https://www.cveoy.top/t/topic/iSHQ 著作权归作者所有。请勿转载和采集!