UNPKG

845 BTypeScriptView Raw
1/**
2 * 返回前几月或后几月的日期
3 * @param date 字符串/日期/时间戳
4 * @param offset 月偏移量(默认0)、前几个月、后几个月
5 */
6export declare function getWhatMonth(date: string | Date | number, offset: number): Date;
7
8/**
9 * 返回前几月或后几月的日期,可以指定月初(first)、月末(last)、天数,默认当前
10 * @param date 字符串/日期/时间戳
11 * @param offset 月偏移量(默认默认当前月)、前几个月、后几个月
12 * @param day 获取哪天:月初(first)、月末(last)、指定天数(数值)
13 */
14export declare function getWhatMonth(date: string | Date | number, offset: number, day: number | 'first' | 'last'): Date;
15
16declare module './ctor' {
17 interface XEUtilsMethods {
18 getWhatMonth: typeof getWhatMonth;
19 }
20}
21
22export default getWhatMonth