แปลง เวลา iso
This commit is contained in:
parent
a74089355f
commit
4a5f7b8389
1 changed files with 10 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { defineStore } from "pinia";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import moment from "moment";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
|
|
@ -252,12 +253,12 @@ export const useDataStore = defineStore("systemStore", () => {
|
|||
date: convertCronToForm(item.schedule, "date") || "",
|
||||
timeStartEvery:
|
||||
convertCronToForm(item.schedule, "timeStartEvery") || "",
|
||||
startAt: item.startAt,
|
||||
startAt: moment(item.startAt)
|
||||
.utcOffset(7)
|
||||
.format("YYYY-MM-DD HH:mm"),
|
||||
enabled: item.enabled,
|
||||
};
|
||||
});
|
||||
|
||||
console.log(dataSchedule.value);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -280,11 +281,14 @@ export const useDataStore = defineStore("systemStore", () => {
|
|||
});
|
||||
}
|
||||
|
||||
async function editSchedule(data: ScheduleCreate) {
|
||||
async function editSchedule(id: string, data: ScheduleCreate) {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.backup + "/schedule", {
|
||||
data,
|
||||
.put(config.API.backup + "/schedule/" + id, {
|
||||
startAt: data.startAt !== undefined ? data.startAt : undefined,
|
||||
enabled: data.enabled,
|
||||
schedule: data.schedule,
|
||||
name: data.name,
|
||||
})
|
||||
.then(async (res) => {
|
||||
return res.data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue