Methods
date->isEqual()
Check whether two date instances share the exact same calendar date coordinates regardless of time.
The isEqual 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
use NepaliDateLibrary\NepaliDate;Signature
public function isEqual(NepaliDate $date): 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
use NepaliDateLibrary\NepaliDate;
$d1 = new NepaliDate('2081-07-15');
$d2 = new NepaliDate('2081-07-15');
var_dump($d1->isEqual($d2)); // trueRelated
date->isSame(): Compare with custom granularity.date->isBefore(): Check chronological order.
Advertisement
date->isAfter()
Check whether the current date occurs chronologically after another specified date.
date->isSame()
Check whether two dates match across a specified granularity such as year, month, or day.