feat: 添加 dayjs 库以处理日期格式化

为了在课程详情页面中正确显示创建日期,我们添加了 dayjs 库来格式化日期字符串。这样,我们可以将日期显示为 "YYYY-MM-DD HH:mm:ss" 的格式。

- 添加了 dayjs 库的依赖
- 在课程详情页面中使用 dayjs 格式化创建日期
This commit is contained in:
2024-09-20 17:28:52 +08:00
parent 37f952911c
commit bc4cb97dea
5 changed files with 35 additions and 5 deletions

View File

@ -0,0 +1,12 @@
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
import duration from "dayjs/plugin/duration";
import "dayjs/locale/zh-cn";
dayjs.extend(relativeTime);
dayjs.extend(duration);
dayjs.locale('zh-cn')
export const useDayjs = () => {
return dayjs;
}