diff --git a/src/pages/localTool/standCalendar/index.vue b/src/pages/localTool/standCalendar/index.vue index bb8c46b5d..5db4d9c99 100644 --- a/src/pages/localTool/standCalendar/index.vue +++ b/src/pages/localTool/standCalendar/index.vue @@ -117,6 +117,9 @@ export default { if (mm<10) { mm = this.padding0(mm, 2) } + if (dd<10) { + dd = this.padding0(dd, 2) + } this.nowDate = yy + '-' + mm + '-' + dd this.formData.year = yy + '年' this.formData.month = mm + '月' @@ -200,8 +203,14 @@ export default { let yy = new Date().getFullYear(); let mm = new Date().getMonth() + 1; let dd = new Date().getDate(); - this.formData.year = yy + '年' + if (mm<10) { + mm = this.padding0(mm, 2) + } this.formData.month = mm + '月' + if (dd<10) { + dd = this.padding0(dd, 2) + } + this.formData.year = yy + '年' this.nowDate = yy + '-' + mm + '-' + dd this.getMonthData() },