Explorar el Código

fix: the end time of recur schedule when publishing

Casper Dai hace 3 años
padre
commit
9d2eb8aa08
Se han modificado 1 ficheros con 7 adiciones y 8 borrados
  1. 7 8
      src/views/schedule/deploy/index.vue

+ 7 - 8
src/views/schedule/deploy/index.vue

@@ -4,9 +4,7 @@
       class="l-flex__none c-sidebar has-padding"
       @change="onChange"
     />
-    <div
-      class="l-flex__auto l-flex--col has-padding"
-    >
+    <div class="l-flex__auto l-flex--col has-padding">
       <div class="l-flex__none l-flex--row has-bottom-padding">
         <div class="l-flex__auto" />
         <button
@@ -52,9 +50,7 @@
             @change="onDateTimeChange('endDateTime')"
           />
         </div>
-        <schedule
-          :schedule="scheduleId"
-        />
+        <schedule :schedule="scheduleId" />
       </template>
     </div>
     <el-dialog
@@ -95,7 +91,10 @@ import {
   getSchedules,
   publish
 } from '@/api/calendar'
-import { createListOptions } from '@/utils'
+import {
+  createListOptions,
+  parseTime
+} from '@/utils'
 import {
   State,
   ScheduleType
@@ -273,7 +272,7 @@ export default {
       }
       publish(this.schedule, this.selectedDevices, {
         startDateTime: this.startDateTime,
-        endDateTime: this.endDateTime
+        endDateTime: this.endDateTime ? parseTime(new Date(this.endDateTime).getTime() + 1000, '{y}-{m}-{d} {h}:{i}:{s}') : ''
       }).then(() => {
         this.schedule = null
       })