Methods
date->getWeeksInMonth()
Calculate the number of calendar week rows required to render the current month in a grid.
The getWeeksInMonth method computes the total number of seven day week rows required to display the entire month in a standard calendar grid. Depending on which weekday the month starts on and how many days it contains, the returned count is usually five or six rows.
Import
use NepaliDateLibrary\NepaliDate;Signature
public function getWeeksInMonth(): int;Parameters
- None.
Return Value
- Type:
int - Range:
4,5, or6 - Description: Number of week rows needed for a calendar view.
Example
use NepaliDateLibrary\NepaliDate;
$date = new NepaliDate('2081-01-01');
echo "Weeks in month: " . $date->getWeeksInMonth();Related
NepaliDate::getCalendarDays(): Matrix grid builder.date->daysInMonth(): Total days in month.
Advertisement
date->daysInMonth()
Retrieve the total number of days in the current or specified Bikram Sambat month.
date->getCurrentQuarter()
Return the standard Bikram Sambat calendar quarter number from one to four for the current date.