Methods
date->isValidInstance()
Validate whether the current NepaliDate instance represents a legitimate calendar date within supported bounds.
The isValidInstance 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
use NepaliDateLibrary\NepaliDate;Signature
public function isValidInstance(): bool;Parameters
- None.
Return Value
- Type:
bool - Description: Returns
trueif the date is valid.
Example
use NepaliDateLibrary\NepaliDate;
$date = new NepaliDate('2081-07-15');
var_dump($date->isValidInstance()); // trueRelated
NepaliDate::isValid(): Static validation method.NepaliDate::minimum(): Earliest supported date.
Advertisement
date->isSame()
Check whether two dates match across a specified granularity such as year, month, or day.
date->isLeapYear()
Determine whether the current Bikram Sambat calendar year has three hundred sixty six or more days.