From 7e190cada7f4307474360ef22b9cfdbf1e1dcde6 Mon Sep 17 00:00:00 2001 From: Shaobiao Lin Date: Sun, 7 Jul 2024 18:31:20 +0800 Subject: [PATCH] refactor(date): replace momentjs with dayjs close #25 --- .github/contributing.md | 2 +- .markdownlint.json | 8 +++--- .vitepress/theme/components/PostElements.vue | 6 ++-- .vitepress/theme/components/PostList.vue | 6 ++-- .vitepress/theme/components/ProfileExtra.vue | 5 ++-- .vitepress/theme/dayjs.ts | 10 +++++++ package-lock.json | 29 +++----------------- package.json | 6 ++-- 8 files changed, 31 insertions(+), 41 deletions(-) create mode 100644 .vitepress/theme/dayjs.ts diff --git a/.github/contributing.md b/.github/contributing.md index 156e8c6..252f36e 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -32,7 +32,7 @@ npm run build npm run preview ``` -There are several other npm script commands in the `scripts` part of [`package.json`](../package.json) that you might want to use. +There are several other npm script commands that you might want to use in the `scripts` part of [`package.json`](../package.json). ### Visual Studio Code diff --git a/.markdownlint.json b/.markdownlint.json index c095ba8..cd62c5c 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,10 +1,10 @@ { "README": { - "cli": "https://github.com/igorshubovych/markdownlint-cli", "rules": "https://github.com/DavidAnson/markdownlint", + "cli": "https://github.com/DavidAnson/markdownlint-cli2", "vscode": "https://github.com/DavidAnson/vscode-markdownlint" }, - "MD013": false, - "MD026": false, - "MD033": false + "line-length": false, + "no-inline-html": false, + "no-trailing-punctuation": false } diff --git a/.vitepress/theme/components/PostElements.vue b/.vitepress/theme/components/PostElements.vue index ef3add4..c6a2777 100644 --- a/.vitepress/theme/components/PostElements.vue +++ b/.vitepress/theme/components/PostElements.vue @@ -8,9 +8,9 @@ - {{ moment(post.datetime).format("LL") }} + {{ dayjs(post.datetime).format("LL") }}