Commit 22008a04 by xiexiaoqin

fix: every min to every 5 min

parent 26b07d2b
...@@ -2,14 +2,22 @@ const currentDate = new Date(); ...@@ -2,14 +2,22 @@ const currentDate = new Date();
const weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; const weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
const durationList = [{ value: 60, label: '1小时' }, { value: 120, label: '2小时' }, { value: 30, label: '30分钟' }]; const durationList = [{ value: 60, label: '1小时' }, { value: 120, label: '2小时' }, { value: 30, label: '30分钟' }];
const timeData = generateDate(365); const timeData = generateDate(365);
const timeHour = generateTime(24); const timeHour = generateHour(24);
const timeMin = generateTime(60); const timeMin = generateMin(60);
function padZero(val) { function padZero(val) {
return ("00" + val).slice(-2); return ("00" + val).slice(-2);
} }
// 生成小时和分钟 // 生成分钟 每隔五分钟
function generateTime(max) { function generateMin(max) {
const time = [];
for (let i = 0; i < max; i+=5) {
time.push(padZero(i))
}
return time;
}
// 生成小时
function generateHour(max) {
const time = []; const time = [];
for (let i = 0; i < max; i++) { for (let i = 0; i < max; i++) {
time.push(padZero(i)) time.push(padZero(i))
...@@ -229,7 +237,7 @@ Component({ ...@@ -229,7 +237,7 @@ Component({
}, },
onChange(e) { onChange(e) {
const pickValue = e.detail.value; const pickValue = e.detail.value;
console.log(pickValue)
if (this.data.currentTab === 'start') { if (this.data.currentTab === 'start') {
const startDate = getDateByPickValue(pickValue); const startDate = getDateByPickValue(pickValue);
this.changeStart(startDate, pickValue); this.changeStart(startDate, pickValue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment