Methods
date->endOfWeek()
Return a new NepaliDate instance set to the final day of the current week on Saturday.
The endOfWeek method produces a new NepaliDate instance representing the last day of the week containing the current date. In standard Nepali calendar practice, Saturday is regarded as the final day of the weekly cycle.
Import
use NepaliDateLibrary\NepaliDate;Signature
public function endOfWeek(int $startOfWeek = 0): self;Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
$startOfWeek | int | No | 0 | Weekday index treated as week start. |
Return Value
- Type:
NepaliDate - Description: New date instance set to Saturday (index 6).
Example
use NepaliDateLibrary\NepaliDate;
$date = new NepaliDate('2081-07-15');
$weekEnd = $date->endOfWeek();
echo $weekEnd->getDay(); // 6 (Saturday)Related
date->startOfWeek(): First day of the week.date->endOfMonth(): Final day of the month.
Advertisement
date->startOfWeek()
Return a new NepaliDate instance set to the first day of the week on Sunday.
date->startOfMonth()
Return a new NepaliDate instance set to the first day of the current Bikram Sambat month.