mirror of
https://github.com/langgenius/dify.git
synced 2026-05-02 16:38:04 +08:00
chore: merge
This commit is contained in:
12
web/utils/time.ts
Normal file
12
web/utils/time.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import dayjs, { type ConfigType } from 'dayjs'
|
||||
import utc from 'dayjs/plugin/utc'
|
||||
|
||||
dayjs.extend(utc)
|
||||
|
||||
export const isAfter = (date: ConfigType, compare: ConfigType) => {
|
||||
return dayjs(date).isAfter(dayjs(compare))
|
||||
}
|
||||
|
||||
export const formatTime = ({ date, dateFormat }: { date: ConfigType; dateFormat: string }) => {
|
||||
return dayjs(date).format(dateFormat)
|
||||
}
|
||||
Reference in New Issue
Block a user