Commit b954900f by 杨北旺

修复时间获取问题

1 parent 8add8984
...@@ -62,7 +62,7 @@ Component({ ...@@ -62,7 +62,7 @@ Component({
const year = time.getFullYear(); const year = time.getFullYear();
const mouth = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1); const mouth = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1);
const day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate(); const day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate();
const YYMMDD = year + '.' + mouth + '.' + day; const YYMMDD = year + '/' + mouth + '/' + day;
dates.push(YYMMDD); dates.push(YYMMDD);
} }
console.log(dates) console.log(dates)
...@@ -90,7 +90,7 @@ Component({ ...@@ -90,7 +90,7 @@ Component({
dateValues.push(days.length) dateValues.push(days.length)
hourValues.push(defalutHIndex) hourValues.push(defalutHIndex)
minuteValues.push(defalutMIndex) minuteValues.push(defalutMIndex)
this.currentDate = new Date().format('yyyy.MM.dd') this.currentDate = new Date().format('yyyy/MM/dd')
this.currentHour = HOUR_STR this.currentHour = HOUR_STR
this.currentMinute = MUNTUE_STR this.currentMinute = MUNTUE_STR
this.setData({ this.setData({
...@@ -123,7 +123,7 @@ Component({ ...@@ -123,7 +123,7 @@ Component({
confirm() { confirm() {
let str = '' let str = ''
str = this.currentDate + ' ' + this.currentHour + ':' + this.currentMinute + ":00" 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) this.triggerEvent('confirm', result)
} }
}, },
...@@ -131,7 +131,7 @@ Component({ ...@@ -131,7 +131,7 @@ Component({
lifetimes: { lifetimes: {
attached: function () { attached: function () {
const today = new Date() 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 \ 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!