bs-calendar-react
Version:
A npm package for nepali calendar with holiday.
50 lines (49 loc) • 1.48 kB
TypeScript
interface IBikDate {
year: number;
month: number;
day: number;
}
interface Props {
year?: number;
month?: number;
}
export interface IHoliday {
bs_date: string;
holiday: string[];
date: string;
}
interface IMonthDay {
date: string;
month: number;
day: number;
}
export interface IMonthDayWithHoliday extends IMonthDay {
bs_date: string;
holiday: string[];
date: string;
}
export declare const useCalendar: ({ year, month }: Props) => {
today: IMonthDay;
monthsWithHolidays: IMonthDayWithHoliday[];
getMonthDaysWithHolidays: () => IMonthDayWithHoliday[];
currentBikDay: number;
currentBikDate: IBikDate;
currentBikMonth: number;
currentNoOfMonths: number;
currentBikYear: number;
getThisMonths: () => IMonthDay[];
};
export declare const extractDayFromBikDate: (date: IBikDate) => number;
export declare const extractMonthFromBikDate: (date: IBikDate) => number;
export declare const extractYearFromBikDate: (date: IBikDate) => number;
export declare const daysInMonth: (year: number, month: number) => number;
export declare const currentMonthDays: (date: IBikDate) => IMonthDay[];
export declare const getNextMonth: (date: IBikDate) => IBikDate;
export declare const getPrevMonth: (date: IBikDate) => IBikDate;
export declare const mapHolidays: (date: IBikDate) => any[];
export declare const getCurrentDate: () => {
year: number;
month: number;
day: number;
};
export {};