Joutsen  v0.4.1
Static Public Member Functions | List of all members
Joutsen.System.CalendarExtensions Class Reference

A collection of methods that extend a calendars functionality. More...

Static Public Member Functions

static int GetWeeksInMonth (this Calendar calendar, int year, int month, DayOfWeek firstDayOfWeek)
 Fetches the number of weeks a month covers. More...
 
static int GetWeeksInYear (this Calendar calendar, int year, CalendarWeekRule calendarweekRule, DayOfWeek firstDayOfWeek)
 Fetches the number of weeks in a given year. More...
 

Detailed Description

A collection of methods that extend a calendars functionality.

Since
0.4.1

Member Function Documentation

◆ GetWeeksInMonth()

static int Joutsen.System.CalendarExtensions.GetWeeksInMonth ( this Calendar  calendar,
int  year,
int  month,
DayOfWeek  firstDayOfWeek 
)
static

Fetches the number of weeks a month covers.

the calendar to determine the number of weeks the year of the month the month for which to determine the number of weeks the weekday that is considered the start of the week

Returns
the number of weeks covered by the month
Remarks
The number of weeks is not determined by full weeks but by how many weeks have at least one day of the month.

◆ GetWeeksInYear()

static int Joutsen.System.CalendarExtensions.GetWeeksInYear ( this Calendar  calendar,
int  year,
CalendarWeekRule  calendarweekRule,
DayOfWeek  firstDayOfWeek 
)
static

Fetches the number of weeks in a given year.

the calendar to use the year for which to determine the number of weeks the localization specific way to determine the frst week of a year the localization specific first weekday in a week

Returns
the number of weeks