Joutsen v0.5.0+12-g5dd5f7e
Static Public Member Functions | List of all members
Joutsen.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.CalendarExtensions.GetWeeksInMonth ( this Calendar  calendar,
int  year,
int  month,
DayOfWeek  firstDayOfWeek 
)
static

Fetches the number of weeks a month covers.

@calendar the calendar to determine the number of weeks @year the year of the month @month the month for which to determine the number of weeks @firstDayOfWeek 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.CalendarExtensions.GetWeeksInYear ( this Calendar  calendar,
int  year,
CalendarWeekRule  calendarweekRule,
DayOfWeek  firstDayOfWeek 
)
static

Fetches the number of weeks in a given year.

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

Returns
the number of weeks