The properties of the Bikram Sambat date.
Returns a cloned BikramSambat object with a specified amount of time added.
The amount of the specified unit to add to the date.
Optional
unit: ManipulateType = 'day'The unit of time to add. Valid units include 'day', 'month', 'year'.
A new BikramSambat date with the specified amount of time added
Creates and returns a deep copy of the current BikramSambat instance.
A new instance of BikramSambat with the same date properties.
Get or set the Bikram Sambat date.
Optional
value: numberThe date to set. If not provided, returns the current date.
The current date if no value is provided, otherwise a new BikramSambat instance with the updated date.
Get or set the Bikram Sambat day of the week.
Optional
value: numberThe day of the week to set. If not provided, returns the current day of the week.
The current day of the week if no value is provided, otherwise a new BikramSambat instance with the updated day of the week.
Returns a cloned BikramSambat object set to the end of the specified unit.
The unit to set to the end. Valid units include 'day', 'month', 'year'.
A new BikramSambat date set to the end of the specified unit
Formats the BikramSambat date according to the specified format string. Supported tokens:
The format string to use for formatting the date.
The formatted date string.
Checks if the current BikramSambat date is after the given date.
The date to compare with.
Optional
unit: UnitType = 'day'The unit of time to compare. Defaults to 'day'.
True if the current date is after the given date, false otherwise.
Checks if the current BikramSambat date is before the given date.
The date to compare with.
Optional
unit: UnitType = 'day'The unit of time to compare. Defaults to 'day'.
True if the current date is before the given date, false otherwise.
Determines if a given BikramSambat or Date object falls between two specified dates, considering boundary inclusion.
Supported boundaryInclusion values:
The start date to compare against.
The end date to compare against.
Optional
unit: ManipulateType = 'day'The unit of time for comparison. Defaults to 'day'.
Optional
boundaryInclusion: The boundary inclusion type for comparison. Defaults to '()'.
True if the date is between startDate and endDate according to the specified boundaryInclusion, false otherwise.
Checks if the current BikramSambat date is the same as the given date.
The date to compare with.
Optional
unit: UnitType = 'day'The unit of time to compare. Defaults to 'day'.
True if the dates are the same, false otherwise.
Get or set the Bikram Sambat month.
If setting the month, it adjusts the date to ensure it is valid within the new month.
Optional
value: numberThe month to set. If not provided, returns the current month.
Set the value of a specific unit (day, month, year, date).
The unit type to set the value of ('day', 'month', 'year', 'date').
The value to set for the specified unit.
A new BikramSambat instance with the updated unit value.
Returns a cloned BikramSambat object set to the start of the specified unit.
The unit to set to the start. Valid units include 'day', 'month', 'year'.
A new BikramSambat date set to the start of the specified unit
Returns a cloned BikramSambat object with a specified amount of time subtracted.
The amount of the specified unit to subtract from the date.
Optional
unit: ManipulateType = 'day'The unit of time to subtract. Valid units include 'day', 'month', 'year'.
A new BikramSambat date with the specified amount of time subtracted
Returns the BikramSambat object as a string.
Formatted BikramSambat date as a formatted string MMMM D YYYY
.
Get or set the Bikram Sambat year.
If setting the year, it adjusts the date to ensure it is valid within the new year.
Optional
value: numberThe year to set. If not provided, returns the current year.
The current year if no value is provided, otherwise a new BikramSambat instance with the updated year.
Static
fromADParses and validates the given AD date and returns an instance of BikramSambat for that date.
AD Date object or string to be parsed. Valid pattern for string: YYYY-MM-DD
An instance of BikramSambat
Static
getReturns a list of months and their total number of days of the year.
Year to get the total number of days for each month.
Array of months and their total number of days.
Static
nowReturns an instance of BikramSambat for today's date.
An instance of BikramSambat for today's date.
Static
parseParses and validates the given BS date and returns an instance of BikramSambat for that date.
BS Date string to be parsed. Valid pattern: YYYY-MM-DD
An instance of BikramSambat
Represents a Bikram Sambat date. Provides various methods to manipulate and format Bikram Sambat dates.