From f2424f306be40e27c76def020ecb2ce1ec2aad4e Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 19 Mar 2023 04:32:36 +0900 Subject: refactor: change type of Revision.date --- nuldoc-src/components/post_page_entry.ts | 9 +++++---- nuldoc-src/components/slide_page_entry.ts | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'nuldoc-src/components') diff --git a/nuldoc-src/components/post_page_entry.ts b/nuldoc-src/components/post_page_entry.ts index e825dfd..685c03a 100644 --- a/nuldoc-src/components/post_page_entry.ts +++ b/nuldoc-src/components/post_page_entry.ts @@ -4,6 +4,7 @@ import { getPostUpdatedDate, PostPage, } from "../pages/post.ts"; +import { dateToString } from "../revision.ts"; export function postPageEntry(post: PostPage): Element { return el( @@ -27,8 +28,8 @@ export function postPageEntry(post: PostPage): Element { [["class", "entry-footer"]], el( "time", - [["datetime", getPostCreatedDate(post)]], - text(getPostCreatedDate(post)), + [["datetime", dateToString(getPostCreatedDate(post))]], + text(dateToString(getPostCreatedDate(post))), ), text(" 投稿"), ...(post.revisions.length > 1 @@ -36,8 +37,8 @@ export function postPageEntry(post: PostPage): Element { text("、"), el("time", [[ "datetime", - getPostUpdatedDate(post), - ]], text(getPostUpdatedDate(post))), + dateToString(getPostUpdatedDate(post)), + ]], text(dateToString(getPostUpdatedDate(post)))), text(" 更新"), ] : []), diff --git a/nuldoc-src/components/slide_page_entry.ts b/nuldoc-src/components/slide_page_entry.ts index 3aff5ae..4767ca2 100644 --- a/nuldoc-src/components/slide_page_entry.ts +++ b/nuldoc-src/components/slide_page_entry.ts @@ -1,6 +1,7 @@ import { el, Element, text } from "../dom.ts"; import { getPostCreatedDate, getPostUpdatedDate } from "../pages/post.ts"; import { SlidePage } from "../pages/slide.ts"; +import { dateToString } from "../revision.ts"; export function slidePageEntry(slide: SlidePage): Element { return el( @@ -24,8 +25,8 @@ export function slidePageEntry(slide: SlidePage): Element { [["class", "entry-footer"]], el( "time", - [["datetime", getPostCreatedDate(slide)]], - text(getPostCreatedDate(slide)), + [["datetime", dateToString(getPostCreatedDate(slide))]], + text(dateToString(getPostCreatedDate(slide))), ), text(" 登壇"), ...(slide.revisions.length > 1 @@ -33,8 +34,8 @@ export function slidePageEntry(slide: SlidePage): Element { text("、"), el("time", [[ "datetime", - getPostUpdatedDate(slide), - ]], text(getPostUpdatedDate(slide))), + dateToString(getPostUpdatedDate(slide)), + ]], text(dateToString(getPostUpdatedDate(slide)))), text(" 更新"), ] : []), -- cgit v1.2.3-70-g09d2