import moment from 'moment'; import { DatePickerProps } from '../iPicker'; /** * * 设计方案: 四位以内Y会被rc-picker自动format为YYYY,考虑不足4位时使用S替代Y * * 风险点:若用户format含S,会被误转Y */ declare const getCurrentFormat: (value: string, format: string) => string; /** * @description 获取分割后的date或format数组 * @param {String} dateStr 日期字符串 * @param {Array} joinIcon 分隔符 * @returns 年月日时分秒数字或格式数组 */ declare const splitDate: (dateStr: string, joinIcon: string[]) => string[]; /** * 获取当前日期的分隔位置及分隔符 * @param {String} value 用户输入日期 * @param {Regex} reg 日期分割条件 * @returns {addLength, joinIcon} 分割位置、分隔符 */ declare const findMatchIndexs: (value: string, reg?: RegExp) => { joinIcon: string[]; addLength: number[]; }; /** * @param {String} param.value input date * @param {String} param.format custom format * @param {String} param.locale 多语 * @returns */ declare const autoFormat: ({ value, format, showTime, locale }: { value: string; format: string; showTime: DatePickerProps['showTime']; locale?: string | undefined; }) => { value: string; isChanged: boolean; format: string; }; /** * * 修正日期删除后部分字段缺失 */ declare const deleteFormat: (date: string, format: string) => string; /** * @description 获取时间部分的格式 */ declare const getTimeFormat: (props: DatePickerProps) => string; /** * @description 获取默认格式 */ declare const getDefaultFormat: (picker: string, showTime: any, props: any) => string; /** * * 根据当前日期返回,起始日期和结束日期 * @param {*} value * @param {*} type type为year 返回今年的起始日期和结束日期,type 为month返回这个月的起始日期和结束日期 */ declare const getDate: (value: moment.MomentInput, type: 'year' | 'month') => { startDate: string; endDate: string; }; export { getDate, getCurrentFormat, getDefaultFormat, getTimeFormat, autoFormat, deleteFormat, splitDate, findMatchIndexs };