Calendar Core Class. More...
#include <SCalendar.h>
Static Public Member Functions | |
static BOOL | IsLeapYear (WORD wYear, BOOL &bLeapYear) |
Determines if a year is a leap year. | |
static BOOL | GetDaysNumInYear (WORD wYear, WORD wMonth, WORD wDay, WORD &wDays) |
Calculates the day number within the year (starting from 0, where 0 is January 1st). | |
static BOOL | GetDateFromDays (WORD wYear, WORD wDays, WORD &wMonth, WORD &wDay) |
Calculates the month and day from the day number within the year. | |
static short | GetDayOfWeek (WORD wYear, WORD wMonth, WORD wDay) |
Returns the day of the week. | |
static WORD | GetDaysOfMonth (WORD wYear, WORD wMonth) |
Returns the number of days in a specified month. | |
static BOOL | DateCheck (WORD wYear, WORD wMonth, WORD wDay) |
Validates the year, month, and day. | |
static SStringT | FormatYear (WORD iYear) |
Formats the year display. | |
static SStringT | FormatMonth (WORD iMonth) |
Formats the month display. | |
static SStringT | FormatDay (WORD iDay) |
Formats the day display. | |
Calendar Core Class.
This class is the core of the calendar, with most functions being static.
Definition at line 23 of file SCalendar.h.
|
static |
Validates the year, month, and day.
wYear | The year. |
wMonth | The month. |
wDay | The day. |
Validates the given date. Note: Valid range is (START_YEAR-01-01 to END_YEAR-12-31).
Definition at line 138 of file SCalendar.cpp.
|
static |
Formats the day display.
iDay | The day. |
Definition at line 225 of file SCalendar.cpp.
|
static |
Formats the month display.
iMonth | The month. |
Definition at line 218 of file SCalendar.cpp.
|
static |
Formats the year display.
iYear | The year. |
Formats the year display, using the Chinese zodiac for the lunar year.
Definition at line 213 of file SCalendar.cpp.
|
static |
Calculates the month and day from the day number within the year.
wYear | The year. |
wDays | The day number within the year. |
wMonth | [output] The month. |
wDay | [output] The day. |
Given a year and day number, calculates the corresponding month and day. Note: Valid range is (START_YEAR to END_YEAR-1).
Definition at line 86 of file SCalendar.cpp.
|
static |
Returns the day of the week.
wYear | The year. |
wMonth | The month. |
wDay | The day. |
Given a date, returns the day of the week. Note: Valid range is (START_YEAR-01-01 to END_YEAR-12-31).
Definition at line 176 of file SCalendar.cpp.
|
static |
Calculates the day number within the year (starting from 0, where 0 is January 1st).
wYear | The year. |
wMonth | The month. |
wDay | The day. |
wDays | [output] The day number within the year. |
Given a date, calculates the day number within that year, starting from 0. Note: Valid range is (START_YEAR to END_YEAR-1).
Definition at line 63 of file SCalendar.cpp.
|
static |
Returns the number of days in a specified month.
wYear | The year. |
wMonth | The month. |
Given a year and month, returns the number of days in that month. Note: Valid range is (START_YEAR-01 to END_YEAR-12).
Definition at line 190 of file SCalendar.cpp.
|
static |
Determines if a year is a leap year.
wYear | The year to check. |
bLeapYear | [output] TRUE if leap year, FALSE if common year. |
Checks if the given year is a leap year. Note: Valid range is (1600 to 6999).
Definition at line 46 of file SCalendar.cpp.