From f65e85c31958e184bfc29fbd15129c949d80b61b Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih Date: Thu, 9 Nov 2023 22:22:26 +0900 Subject: [PATCH] =?UTF-8?q?(enhance)=20=E4=BA=88=E7=B4=84=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E5=AE=8C=E4=BA=86=E3=81=97=E3=81=9F=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=82=92=E3=82=8F=E3=81=8B=E3=82=8A=E3=82=84=E3=81=99=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + packages/frontend/src/components/MkPostForm.vue | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/locales/index.d.ts b/locales/index.d.ts index 23eb3ec419..00dc9eb9e7 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -2474,6 +2474,7 @@ export interface Locale { "postTime": string; "localTime": string; "addSchedule": string; + "willBePostedAtX": string; }; } declare const locales: { diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 69c834d11d..003e26f792 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2362,3 +2362,4 @@ _schedulePost: postTime: "時刻" localTime: "端末に設定されているタイムゾーンの時刻で投稿されます。" addSchedule: "予約設定" + willBePostedAtX: "このノートは{date}に投稿されます。" diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index bebaf36a17..d3645d35d6 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -111,6 +111,7 @@ import { formatTimeString } from '@/scripts/format-time-string.js'; import { Autocomplete } from '@/scripts/autocomplete.js'; import * as os from '@/os.js'; import { selectFiles } from '@/scripts/select-file.js'; +import { dateTimeFormat } from '@/scripts/intl-const.js'; import { defaultStore, notePostInterruptors, postFormActions } from '@/store.js'; import MkInfo from '@/components/MkInfo.vue'; import { i18n } from '@/i18n.js'; @@ -808,6 +809,13 @@ async function post(ev?: MouseEvent) { claimAchievement('notes1'); } poll = null; + + if (postData.schedule?.expiresAt) { + const d = new Date(postData.schedule.expiresAt); + const str = dateTimeFormat.format(d); + os.toast(i18n.t('_schedulePost.willBePostedAtX', { date: str })); + } + const text = postData.text ?? ''; const lowerCase = text.toLowerCase(); if ((lowerCase.includes('love') || lowerCase.includes('❤')) && lowerCase.includes('misskey')) {