14 lines
346 B
TypeScript
Raw Normal View History

2026-01-08 16:35:06 +08:00
import dayjs from 'dayjs';
export const isInTimeRange = (startTime?: string, endTime?: string) => {
const now = dayjs();
const start = dayjs(startTime);
const end = dayjs(endTime);
return now.isAfter(start) && now.isBefore(end);
};
export function showTime(time?: string, num?: number) {
return time?.substring(0, num || 5) || '';
}