Methods
date.getDate()
Retrieve the numeric day of the month from a NepaliDate instance.
The getDate method returns the day of the month as an integer from 1 to 32 for the current NepaliDate instance. Unlike Gregorian months which have at most 31 days, Bikram Sambat calendar months can extend up to 32 days depending on the year and month.
Import
import { NepaliDate } from "nepali-date-library";Signature
getDate(): number;Parameters
- None.
Return Value
- Type:
number - Range:
1to32(depending on the month and year).
Example
import { NepaliDate } from "nepali-date-library";
const date = new NepaliDate("2081-07-15");
console.log(date.getDate()); // 15Related
date.setDate(): Mutate the day of the month.date.getDay(): Retrieve the day of the week (0–6).date.daysInMonth(): Query total days in this month.
Advertisement
date.getMonth()
Retrieve the zero based Bikram Sambat month index from zero for Baisakh to eleven for Chaitra.
date.getDay()
Retrieve the numeric day of the week index from zero for Sunday through six for Saturday.