UNPKG

react-gantt-svg

Version:

A React Gantt chart component library

59 lines (58 loc) 2.32 kB
import { type Task, ViewMode } from '../types'; type DateHelperScales = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond'; export declare const getCachedDateTimeFormat: (locString: string | string[], opts?: Intl.DateTimeFormatOptions) => Intl.DateTimeFormat; /** * 向时间戳添加指定的时间量 * @param timestamp 时间戳(毫秒) * @param quantity 要添加的数量 * @param scale 时间单位 * @returns 新的时间戳 */ export declare const addToDate: (timestamp: number, quantity: number, scale: DateHelperScales) => number; /** * 获取时间戳在指定时间单位的开始时间 * @param timestamp 时间戳(毫秒) * @param scale 时间单位 * @returns 新的时间戳 */ export declare const startOfDate: (timestamp: number, scale: DateHelperScales) => number; /** * 计算甘特图的日期范围 * @param tasks 任务列表 * @param viewMode 视图模式 * @param preStepsCount 前置步骤数量 * @param calendarRange 可选的日历范围(时间戳数组) * @returns 日期范围(时间戳数组) */ export declare const ganttDateRange: (tasks: Task[], viewMode: ViewMode, preStepsCount: number, calendarRange?: [number, number]) => [number, number]; /** * 生成日期序列 * @param startDate 开始时间戳 * @param endDate 结束时间戳 * @param viewMode 视图模式 * @returns 时间戳数组 */ export declare const seedDates: (startDate: number, endDate: number, viewMode: ViewMode) => number[]; /** * 获取本地化的月份名称 * @param timestamp 时间戳(毫秒) * @param locale 语言环境 * @returns 本地化的月份名称 */ export declare const getLocaleMonth: (timestamp: number, locale: string) => string; /** * 获取本地化的星期名称 * @param timestamp 时间戳(毫秒) * @param locale 语言环境 * @param format 格式类型 * @returns 本地化的星期名称 */ export declare const getLocalDayOfWeek: (timestamp: number, locale: string, format?: "long" | "short" | "narrow" | undefined) => string; /** * 获取ISO 8601标准的周数 * @param timestamp 时间戳(毫秒) * @returns 周数字符串 */ export declare const getWeekNumberISO8601: (timestamp: number) => string; export declare const getDaysInMonth: (month: number, year: number) => number; export {};