File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1- import dayjs from 'dayjs'
1+ import dayjs , { ConfigType } from 'dayjs'
22
33export class VipDayjs {
44 /**
@@ -24,22 +24,22 @@ export class VipDayjs {
2424 * 是否在当前时间之前
2525 * @param date
2626 */
27- public isBeforeNow ( date : Date ) : boolean {
27+ public isBeforeNow ( date ?: ConfigType ) : boolean {
2828 return dayjs ( ) . isBefore ( dayjs ( date ) )
2929 }
3030
3131 /**
3232 * 是否在当前时间之后
3333 * @param date
3434 */
35- public isAfterNow ( date : Date ) : boolean {
35+ public isAfterNow ( date ?: ConfigType ) : boolean {
3636 return dayjs ( ) . isAfter ( dayjs ( date ) )
3737 }
3838
3939 /**
4040 * 时间格式化,默认: 年-月-日 时:分:秒
4141 */
42- public formatDateToStr ( date : Date , template ?: string ) : string {
42+ public formatDateToStr ( date : ConfigType , template ?: string ) : string {
4343 return dayjs ( date ) . format ( template ?? this . FORMAT_TEMPLATE_STR )
4444 }
4545
You can’t perform that action at this time.
0 commit comments