nepali-date-selector
Version:
Nepali Date Selector
48 lines (46 loc) • 1.94 kB
TypeScript
import { ParsedDate, SplittedDate, voidFunction } from '../Types';
export declare const range: (start: number, end: number, step?: number) => number[];
export declare const zeroPad: (num: number) => string;
export declare const executionDelegation: (execution: voidFunction, delegatedExecution: voidFunction) => void;
export declare const splitDate: (date: string, separator?: string) => SplittedDate;
export declare const stitchDate: (date: SplittedDate, separator?: string) => string;
export declare const validateDateObject: (date: SplittedDate, type?: string) => void;
export declare const getNumberOfDaysInBSMonth: (yearMonth: {
year: number;
month: number;
}) => number;
/**
* Get today's Nepali date in YYYY-MM-DD format
* Uses local date at noon to avoid timezone issues
*/
export declare const getTodayNepaliDate: () => string;
/**
* Convert English/AD date (YYYY-MM-DD or Date) to Nepali/BS date (YYYY-MM-DD)
* @param adDate - English date as Date object or string (YYYY-MM-DD)
* @returns Nepali date string (YYYY-MM-DD)
*/
export declare const convertADToBS: (adDate: Date | string) => string;
/**
* Convert Nepali/BS date (YYYY-MM-DD) to English/AD date (YYYY-MM-DD)
* @param bsDateString - Nepali date string (YYYY-MM-DD)
* @returns English date string (YYYY-MM-DD)
*/
export declare const convertBSToAD: (bsDateString: string) => string;
export declare const parseBSDate: (date: string, separator?: string) => ParsedDate;
/**
* Check if a date string is valid BS date
*/
export declare const isValidBSDate: (dateString: string) => boolean;
/**
* Get current Nepali year
*/
export declare const getCurrentNepaliYear: () => number;
/**
* Get current Nepali month (1-12)
*/
export declare const getCurrentNepaliMonth: () => number;
/**
* Get current Nepali day
*/
export declare const getCurrentNepaliDay: () => number;
export declare const childOf: (childNode: any, parentNode: any) => boolean;