dify/web/utils/time.ts
Wu Tianwei 49feff082f
feat: parent child retrieval (#12106)
Signed-off-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
2024-12-26 12:01:51 +08:00

13 lines
356 B
TypeScript

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)
}