import { TypeDate } from '../types'; export declare const TimeUnits: readonly ["hour", "day", "week", "month", "year"]; export type TypeTimeUnit = typeof TimeUnits[number]; /** * 获取某个时间的 整年|整月|整日|整时|整分 时间对象 * @method getTimeSplit * @param {Number|Date} time 实际时间 * @param {String} type 单位时间类型,可选 ['year', 'month', 'week', 'day', 'hour'] * @return {Date} 时间整点对象 * @example * import { getTimeSplit } from '@spore-ui/tskit'; * new Date( * getTimeSplit( * '2018-09-20', * 'month' * ) * ).toGMTString(); * // Sat Sep 01 2018 00:00:00 GMT+0800 (中国标准时间) * * new Date( * getTimeSplit( * '2018-09-20 19:23:36', * 'hour' * ) * ).toGMTString(); * // Thu Sep 20 2018 19:00:00 GMT+0800 (中国标准时间) */ export declare function getTimeSplit(time: TypeDate, type?: TypeTimeUnit): Date; export default getTimeSplit;