Methods
date.is_valid_instance()
Validate whether the current NepaliDate instance represents a legitimate calendar date within supported bounds.
The is_valid_instance method checks whether the current NepaliDate instance contains valid calendar values and falls within the supported range of 1976 through 2100 BS. It verifies that year, month, and day coordinates correspond to an authentic historical date.
Import
from nepali_date_library import NepaliDateSignature
def is_valid_instance(self) -> bool:Parameters
- None.
Return Value
- Type:
bool - Description: Returns
Trueif the date is valid.
Example
from nepali_date_library import NepaliDate
date = NepaliDate("2081-07-15")
print(date.is_valid_instance()) # TrueRelated
NepaliDate.is_valid(): Static validation method.NepaliDate.minimum(): Earliest supported date.
Advertisement
date.is_same()
Check whether two dates match across a specified granularity such as year, month, or day.
date.is_leap_year()
Determine whether the current Bikram Sambat calendar year has three hundred sixty six or more days.