startAt -> startsAt

This commit is contained in:
syuilo
2023-02-15 14:31:59 +09:00
parent 71c42bef9b
commit e24b0ceb80
6 changed files with 16 additions and 16 deletions

View File

@ -29,7 +29,7 @@
<MkInput v-model="ad.ratio" type="number">
<template #label>{{ i18n.ts.ratio }}</template>
</MkInput>
<MkInput v-model="ad.startAt" type="datetime-local">
<MkInput v-model="ad.startsAt" type="datetime-local">
<template #label>{{ i18n.ts.startingperiod }}</template>
</MkInput>
<MkInput v-model="ad.expiresAt" type="datetime-local">
@ -70,13 +70,13 @@ const localTimeDiff = localTime.getTimezoneOffset() * 60 * 1000;
os.api('admin/ad/list').then(adsResponse => {
ads = adsResponse.map(r => {
const exdate = new Date(r.expiresAt);
const stdate = new Date(r.startAt);
const stdate = new Date(r.startsAt);
exdate.setMilliseconds(exdate.getMilliseconds() - localTimeDiff);
stdate.setMilliseconds(stdate.getMilliseconds() - localTimeDiff);
return {
...r,
expiresAt: exdate.toISOString().slice(0, 16),
startAt: stdate.toISOString().slice(0, 16),
startsAt: stdate.toISOString().slice(0, 16),
};
});
});
@ -91,7 +91,7 @@ function add() {
url: '',
imageUrl: null,
expiresAt: null,
startAt: null,
startsAt: null,
});
}
@ -113,13 +113,13 @@ function save(ad) {
os.apiWithDialog('admin/ad/create', {
...ad,
expiresAt: new Date(ad.expiresAt).getTime(),
startAt: new Date(ad.startAt).getTime(),
startsAt: new Date(ad.startsAt).getTime(),
});
} else {
os.apiWithDialog('admin/ad/update', {
...ad,
expiresAt: new Date(ad.expiresAt).getTime(),
startAt: new Date(ad.startAt).getTime(),
startsAt: new Date(ad.startsAt).getTime(),
});
}
}