convertDate
This commit is contained in:
parent
b589f98bf1
commit
c9ce8482b3
2 changed files with 12 additions and 4 deletions
|
|
@ -34,6 +34,7 @@ const {
|
|||
dialogConfirm,
|
||||
dialogMessageNotify,
|
||||
onSearchDataTable,
|
||||
convertDatetimeToAPI,
|
||||
} = useCounterMixin();
|
||||
const {
|
||||
getSchedule,
|
||||
|
|
@ -64,6 +65,7 @@ const formDataschedule = ref<ScheduleCreate>({
|
|||
name: "",
|
||||
time: "",
|
||||
schedule: "",
|
||||
startAt: new Date(),
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
@ -203,10 +205,16 @@ function onSubmit() {
|
|||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
if (typeOnSubmit.value === "create") {
|
||||
await createSchedule(formDataschedule.value);
|
||||
await createSchedule({
|
||||
...formDataschedule.value,
|
||||
startAt: convertDatetimeToAPI(formDataschedule.value.startAt as Date),
|
||||
});
|
||||
}
|
||||
if (typeOnSubmit.value === "edit") {
|
||||
await editSchedule(idEditSchedule.value, formDataschedule.value);
|
||||
await editSchedule(idEditSchedule.value, {
|
||||
...formDataschedule.value,
|
||||
startAt: convertDatetimeToAPI(formDataschedule.value.startAt as Date),
|
||||
});
|
||||
}
|
||||
getSchedule();
|
||||
hideLoader();
|
||||
|
|
@ -476,7 +484,7 @@ onMounted(async () => {
|
|||
|
||||
if (formDataschedule.startAt !== undefined) {
|
||||
formDataschedule.startAt = new Date(
|
||||
formDataschedule.startAt
|
||||
formDataschedule.startAt as Date
|
||||
).toISOString();
|
||||
}
|
||||
convertFormToCron();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ interface ScheduleCreate {
|
|||
type: string;
|
||||
date: string[];
|
||||
schedule: string;
|
||||
startAt?: string;
|
||||
startAt?: Date|null|string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue