UNPKG

@ce1pers/date-helpers

Version:
54 lines (53 loc) 1.66 kB
import { ConvertDayOptions, ConvertFormat, ObtainFirstDayOptions, ObtainLastDayOptions } from "../types"; /** * Parse day text format. * @param {string} text * @param {ConvertFormat} format */ export declare const parseTextFormat: (text: string, format?: ConvertFormat) => string; /** * Convert day index to string; * @param {number} dayIndex Day value as index. */ export declare const convertDay: (dayIndex: number, options?: ConvertDayOptions) => string | undefined; /** * Obtain first date. */ export declare const obtainFirstDate: (year?: number, month?: number) => Date; /** * Obtain first day. */ export declare const obtainFirstDay: (year?: number, month?: number, options?: ObtainFirstDayOptions) => { dayIndex: number; convertedDay: string | undefined; }; /** * Obtain last date information. * @param {number} year * @param {number} month */ export declare const obtainLastDate: (year?: number, month?: number) => Date; /** * Obtain last day information. */ export declare const obtainLastDay: (year?: number, month?: number, options?: ObtainLastDayOptions) => { dayIndex: number; convertedDay: string | undefined; }; /** * Compute total calendar date count by month. * @param {number} month */ export declare const computeMonthTotalDateCount: (year?: number, month?: number) => { currentMonthDateCount: number; previousMonthDateCount: number; nextMonthDateCount: number; }; /** * Compute current month total calendar date count. */ export declare const computeCurrentMonthTotalDateCount: () => { currentMonthDateCount: number; previousMonthDateCount: number; nextMonthDateCount: number; };