UNPKG

antd-date-picker-nepali

Version:
57 lines (55 loc) 2.16 kB
import { Dayjs } from 'dayjs'; import { NepaliDateType } from './type'; declare class NepaliDateConverter { /** * Validates a given Nepali date. * @param {NepaliDateType} bsDate - The Nepali date to validate. * @returns {boolean} - True if the date is valid, false otherwise. */ static validateBsDate(bsDate: NepaliDateType): boolean; /** * Gets today's Nepali date. * @returns {NepaliDateType} - The current Nepali date. */ static getTodayBs(): NepaliDateType; /** * Gets the weekday for a given Nepali date. * @param {NepaliDateType} bsDate - The Nepali date. * @returns {number} - The weekday (0 = Sunday, 6 = Saturday). */ static getWeekDay(bsDate: NepaliDateType): number; /** * Converts an AD date to a Nepali date. * @param {Dayjs | Date | string} adDate - The AD date to convert. * @returns {NepaliDateType} - The corresponding Nepali date. */ static adToBs(adDate: Dayjs | Date | string): NepaliDateType; /** * Converts a Nepali date to an AD date. * @param {NepaliDateType} bsDate - The Nepali date to convert. * @returns {Dayjs} - The corresponding AD date. */ static bsToAd(bsDate: NepaliDateType): Dayjs; /** * Gets the Nepali date for a given AD date. * @param {Date} adDate - The AD date. * @returns {NepaliDateType} - The corresponding Nepali date. */ static getNepaliDate(adDate: Date): NepaliDateType; /** * Gets the AD date for a given Nepali date. * @param {number} npYear - The Nepali year. * @param {number} npMonth - The Nepali month. * @param {number} npDay - The Nepali day. * @returns {Date} - The corresponding AD date. */ static getEnglishDate(npYear: number, npMonth: number, npDay: number): Date; /** * Gets the number of days in a given Nepali month. * @param {number} year - The Nepali year. * @param {number} month - The Nepali month. * @returns {number} - The number of days in the month. */ static getDaysInMonth(year: number, month: number): number; } export default NepaliDateConverter;