Nepali DateNepali DateBikram Sambat Date Engine
Methods

Packagistdate->startOfWeek()

Return a new NepaliDate instance set to the first day of the week on Sunday.

The startOfWeek method returns a new NepaliDate instance set to Sunday, the first day of the weekly cycle containing the current date. It serves as an anchor date for week based scheduling and calendar grids.


Import

use NepaliDateLibrary\NepaliDate;

Signature

public function startOfWeek(int $startOfWeek = 0): self;

Parameters

ParameterTypeRequiredDefaultDescription
$startOfWeekintNo0Weekday index to treat as week start (0 for Sunday).

Return Value

  • Type: NepaliDate
  • Description: New date instance set to the first day of the week.

Example

use NepaliDateLibrary\NepaliDate;

$date = new NepaliDate('2081-07-15');
$weekStart = $date->startOfWeek();
echo $weekStart->getDay(); // 0 (Sunday)

Advertisement

On this page