scheduledAtをISO8601で指定できるように

Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
This commit is contained in:
mattyatea 2023-11-14 18:39:21 +09:00
parent 271c872c97
commit 380c8c3283
No known key found for this signature in database
GPG Key ID: 068E54E2C33BEF9A
3 changed files with 3 additions and 7 deletions

View File

@ -202,7 +202,7 @@ export const paramDef = {
type: 'object', type: 'object',
nullable: true, nullable: true,
properties: { properties: {
scheduledAt: { type: 'integer', nullable: false }, scheduledAt: { type: 'string', nullable: false },
}, },
}, },
}, },

View File

@ -775,10 +775,6 @@ async function post(ev?: MouseEvent) {
} }
} }
if (postData.schedule?.scheduledAt && typeof postData.schedule.scheduledAt === 'string') {
postData.schedule.scheduledAt = parseInt(postData.schedule.scheduledAt);
}
let token = undefined; let token = undefined;
if (postAccount) { if (postAccount) {

View File

@ -43,12 +43,12 @@ if ( props.modelValue && props.modelValue.scheduledAt) {
function get() { function get() {
const calcAt = () => { const calcAt = () => {
return new Date(`${atDate.value} ${atTime.value}`).getTime(); return new Date(`${atDate.value}T${atTime.value}`).toISOString();
}; };
return { return {
...( ...(
props.modelValue ? { scheduledAt: calcAt() } : {} props.modelValue ? { scheduledAt: calcAt() } : ''
), ),
}; };
} }