Methods
date.is_equal()
Check whether two date instances share the exact same calendar date coordinates regardless of time.
The is_equal method checks whether the current NepaliDate instance shares the exact same Bikram Sambat year, month, and day coordinates as another date object, ignoring any differences in hours, minutes, seconds, or milliseconds.
Import
from nepali_date_library import NepaliDateSignature
def is_equal(self, date: NepaliDate) -> bool:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
date | NepaliDate | Yes | Date instance to compare coordinates with. |
Return Value
- Type:
bool - Description: Returns
Trueif year, month, and day are identical.
Example
from nepali_date_library import NepaliDate
d1 = NepaliDate("2081-07-15")
d2 = NepaliDate("2081-07-15")
print(d1.is_equal(d2)) # TrueRelated
date.is_same(): Compare with custom granularity.date.is_before(): Check chronological order.
Advertisement
date.is_after()
Check whether the current date occurs chronologically after another specified date.
date.is_same()
Check whether two dates match across a specified granularity such as year, month, or day.