Revert "Merge pull request #279 from yzhe819/dev"

This reverts commit 53932b9205, reversing
changes made to b43f385c01.
This commit is contained in:
DIYgod 2023-04-04 00:45:23 +01:00
parent c2411490b1
commit c151d6d2f7
No known key found for this signature in database
3 changed files with 2 additions and 6 deletions

View File

@ -64,7 +64,7 @@ const Post = ({
{t("ago", {
time: date.dayjs
.duration(
date.dayjs(post?.createdAt).tz().diff(date.dayjs(), "minute"),
date.dayjs(post?.createdAt).diff(date.dayjs(), "minute"),
"minute",
)
.humanize(),

View File

@ -32,8 +32,5 @@ export function useDate() {
inLocalTimezone: (date: string | Date) => {
return dayjs(date).tz().toDate()
},
inUTCTimezone: (date: string | Date) => {
return dayjs(date).utc().toDate()
},
}
}

View File

@ -179,7 +179,6 @@ export default function SubdomainEditor() {
...(visibility === PageVisibilityEnum.Draft ? {} : { pageId: pageId }),
isPost: isPost,
published,
publishedAt: getInputDatetimeValue(date.inUTCTimezone(values.publishedAt), date.dayjs.utc),
externalUrl:
(values.slug || defaultSlug) &&
`${getSiteLink({
@ -226,7 +225,7 @@ export default function SubdomainEditor() {
setValues({
title: page.data.title || "",
publishedAt: getInputDatetimeValue(date.inLocalTimezone(page.data.published_at), date.dayjs),
publishedAt: page.data.date_published,
published: !!page.data.id,
excerpt: page.data.summary?.content || "",
slug: page.data.slug || "",