pref: limit the datetime year of the post or page to four digits (#5666)

#### What type of PR is this?

/kind improvement
/area ui

#### What this PR does / why we need it:

限定文章或页面中的发布日期中的年份为四位数,方便用户输入四位年份之后自定跳转至月份。

#### How to test it?

测试在 `chrome` 上输入四位年份之后,是否会自动跳转至月份。

#### Which issue(s) this PR fixes:

Fixes #5630 

#### Does this PR introduce a user-facing change?
```release-note
限定文章或页面中的发布日期中的年份为四位数
```
pull/5697/head
Takagi 2024-04-12 19:28:09 +08:00 committed by GitHub
parent a317ec9563
commit 37f530b619
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 0 deletions

View File

@ -421,6 +421,8 @@ const { handleGenerateSlug } = useSlugify(
:label="$t('core.page.settings.fields.publish_time.label')" :label="$t('core.page.settings.fields.publish_time.label')"
type="datetime-local" type="datetime-local"
name="publishTime" name="publishTime"
min="0000-01-01T00:00"
max="9999-12-31T23:59"
></FormKit> ></FormKit>
<FormKit <FormKit
v-model="formState.spec.template" v-model="formState.spec.template"

View File

@ -395,6 +395,8 @@ const { handleGenerateSlug } = useSlugify(
v-model="publishTime" v-model="publishTime"
:label="$t('core.post.settings.fields.publish_time.label')" :label="$t('core.post.settings.fields.publish_time.label')"
type="datetime-local" type="datetime-local"
min="0000-01-01T00:00"
max="9999-12-31T23:59"
></FormKit> ></FormKit>
<FormKit <FormKit
v-model="formState.spec.template" v-model="formState.spec.template"

View File

@ -187,6 +187,8 @@ const { handleGenerateSlug } = useSlugify(
name="publishTime" name="publishTime"
:label="$t('core.post.settings.fields.publish_time.label')" :label="$t('core.post.settings.fields.publish_time.label')"
type="datetime-local" type="datetime-local"
min="0000-01-01T00:00"
max="9999-12-31T23:59"
></FormKit> ></FormKit>
<HasPermission :permissions="['system:attachments:view']"> <HasPermission :permissions="['system:attachments:view']">
<FormKit <FormKit