Commit b954900f by 杨北旺

修复时间获取问题

1 parent 8add8984
......@@ -62,7 +62,7 @@ Component({
const year = time.getFullYear();
const mouth = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1);
const day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate();
const YYMMDD = year + '.' + mouth + '.' + day;
const YYMMDD = year + '/' + mouth + '/' + day;
dates.push(YYMMDD);
}
console.log(dates)
......@@ -90,7 +90,7 @@ Component({
dateValues.push(days.length)
hourValues.push(defalutHIndex)
minuteValues.push(defalutMIndex)
this.currentDate = new Date().format('yyyy.MM.dd')
this.currentDate = new Date().format('yyyy/MM/dd')
this.currentHour = HOUR_STR
this.currentMinute = MUNTUE_STR
this.setData({
......@@ -123,7 +123,7 @@ Component({
confirm() {
let str = ''
str = this.currentDate + ' ' + this.currentHour + ':' + this.currentMinute + ":00"
const result = new Date(str).format('yyyy-MM-dd hh:mm:ss')
const result = new Date(str).format('yyyy/MM/dd hh:mm:ss')
this.triggerEvent('confirm', result)
}
},
......@@ -131,7 +131,7 @@ Component({
lifetimes: {
attached: function () {
const today = new Date()
this.getDateList('2019.01.01', new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1))
this.getDateList('2019/01/01', new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1))
},
},
})
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!