Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.start_of_week()

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

The start_of_week 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

from nepali_date_library import NepaliDate

Signature

def start_of_week(self, start_of_week: int = 0) -> NepaliDate:

Parameters

ParameterTypeRequiredDefaultDescription
start_of_weekintNo0Weekday 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

from nepali_date_library import NepaliDate

date = NepaliDate("2081-07-15")
week_start = date.start_of_week()
print(week_start.get_day()) # 0 (Sunday)

Advertisement

On this page