We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
formatDateToYMD
1 parent 49e7028 commit 29352bfCopy full SHA for 29352bf
packages/utils/src/pkgs/dayjs.ts
@@ -18,14 +18,24 @@ function formatDateToStr(date: Date, template?: string) {
18
return dayjs(date).format(template ?? FormatTemplateStr)
19
}
20
21
+/**
22
+ * 年月日格式化当前时间
23
+ * - 格式: 2024-08-09
24
+ */
25
+function formatDateToYMD(): string {
26
+ return formatDateToStr(new Date(), 'YYYY-MM-DD')
27
+}
28
+
29
export interface IVipDayjs {
30
getCurrentTimestamp: typeof getCurrentTimestamp
31
FormatTemplateStr: typeof FormatTemplateStr
32
formatDateToStr: typeof formatDateToStr
33
+ formatDateToYMD: typeof formatDateToYMD
34
35
36
export const VipDayjs: IVipDayjs = {
37
getCurrentTimestamp,
38
FormatTemplateStr,
39
formatDateToStr,
40
+ formatDateToYMD,
41
0 commit comments