From 9d5a58aa02f07bbdc2e2e46f4616188d19c8271b Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 11 Jan 2021 09:23:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BD=A6=E4=BD=8D=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=20=E5=8F=96=E6=B6=88=E6=97=B6=E5=88=86=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/components/property/addCar/addCar.js | 10 ++++++---- public/components/property/editCar/editCar.js | 14 +++++++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/public/components/property/addCar/addCar.js b/public/components/property/addCar/addCar.js index 5c7c0a02d..58fcba305 100644 --- a/public/components/property/addCar/addCar.js +++ b/public/components/property/addCar/addCar.js @@ -140,7 +140,7 @@ let _carNumType = $that.addCarInfo.carNumType; if(_carNumType == 'S'){ $that.addCarInfo.startTime = vc.dateTimeFormat(new Date().getTime()); - $that.addCarInfo.endTime = '2037-01-01 00:00:00'; + $that.addCarInfo.endTime = '2037-01-01'; } if(vc.component.addCarValidate()){ @@ -150,11 +150,12 @@ } }, _initDateInfo: function () { - vc.component.addCarInfo.startTime = vc.dateTimeFormat(new Date().getTime()); + vc.component.addCarInfo.startTime = vc.dateFormat(new Date().getTime()); $('.startTime').datetimepicker({ + minView: "month", language: 'zh-CN', fontAwesome: 'fa', - format: 'yyyy-mm-dd hh:ii:ss', + format: 'yyyy-mm-dd', initTime: true, initialDate: new Date(), autoClose: 1, @@ -167,9 +168,10 @@ vc.component.addCarInfo.startTime = value; }); $('.endTime').datetimepicker({ + minView: "month", language: 'zh-CN', fontAwesome: 'fa', - format: 'yyyy-mm-dd hh:ii:ss', + format: 'yyyy-mm-dd', initTime: true, initialDate: new Date(), autoClose: 1, diff --git a/public/components/property/editCar/editCar.js b/public/components/property/editCar/editCar.js index cf5b45f85..74f231a05 100644 --- a/public/components/property/editCar/editCar.js +++ b/public/components/property/editCar/editCar.js @@ -56,6 +56,12 @@ _initEvent: function () { vc.on('editCar', 'openEditCar', function (_carInfo) { vc.copyObject(_carInfo, $that.editCarInfo); + if (_carInfo.startTime.indexOf(":") > -1) { + $that.editCarInfo.startTime = $that.editCarInfo.startTime.substring(0,10); + } + if (_carInfo.endTime.indexOf(":") > -1) { + $that.editCarInfo.endTime = $that.editCarInfo.endTime.substring(0,10); + } $('#editCarModal').modal('show'); vc.component._initEditCarDateInfo(); }); @@ -161,11 +167,12 @@ }); }, _initEditCarDateInfo: function () { - vc.component.editCarInfo.startTime = vc.dateTimeFormat(new Date().getTime()); + //vc.component.editCarInfo.startTime = vc.dateTimeFormat(new Date().getTime()); $('.editCarStartTime').datetimepicker({ + minView: "month", language: 'zh-CN', fontAwesome: 'fa', - format: 'yyyy-mm-dd hh:ii:ss', + format: 'yyyy-mm-dd', initTime: true, initialDate: new Date(), autoClose: 1, @@ -178,9 +185,10 @@ vc.component.editCarInfo.startTime = value; }); $('.editCarEndTime').datetimepicker({ + minView: "month", language: 'zh-CN', fontAwesome: 'fa', - format: 'yyyy-mm-dd hh:ii:ss', + format: 'yyyy-mm-dd', initTime: true, initialDate: new Date(), autoClose: 1,