soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SCalendarCore Class Reference

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.
 

Detailed Description

Calendar Core Class.

This class is the core of the calendar, with most functions being static.

Definition at line 23 of file SCalendar.h.

Member Function Documentation

◆ DateCheck()

BOOL SCalendarCore::DateCheck ( WORD wYear,
WORD wMonth,
WORD wDay )
static

Validates the year, month, and day.

Parameters
wYearThe year.
wMonthThe month.
wDayThe day.
Returns
FALSE – Failure, TRUE – Success

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.

◆ FormatDay()

SStringT SCalendarCore::FormatDay ( WORD iDay)
static

Formats the day display.

Parameters
iDayThe day.
Returns
The formatted day string.

Definition at line 225 of file SCalendar.cpp.

◆ FormatMonth()

SStringT SCalendarCore::FormatMonth ( WORD iMonth)
static

Formats the month display.

Parameters
iMonthThe month.
Returns
The formatted month string.

Definition at line 218 of file SCalendar.cpp.

◆ FormatYear()

SStringT SCalendarCore::FormatYear ( WORD iYear)
static

Formats the year display.

Parameters
iYearThe year.
Returns
The formatted year string.

Formats the year display, using the Chinese zodiac for the lunar year.

Definition at line 213 of file SCalendar.cpp.

◆ GetDateFromDays()

BOOL SCalendarCore::GetDateFromDays ( WORD wYear,
WORD wDays,
WORD & wMonth,
WORD & wDay )
static

Calculates the month and day from the day number within the year.

Parameters
wYearThe year.
wDaysThe day number within the year.
wMonth[output] The month.
wDay[output] The day.
Returns
TRUE – Success, FALSE – Failure

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.

◆ GetDayOfWeek()

short SCalendarCore::GetDayOfWeek ( WORD wYear,
WORD wMonth,
WORD wDay )
static

Returns the day of the week.

Parameters
wYearThe year.
wMonthThe month.
wDayThe day.
Returns
Returns: 0, 1, 2, 3, 4, 5, 6 corresponding to Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday; -1 if date is invalid or out of range.

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.

◆ GetDaysNumInYear()

BOOL SCalendarCore::GetDaysNumInYear ( WORD wYear,
WORD wMonth,
WORD wDay,
WORD & wDays )
static

Calculates the day number within the year (starting from 0, where 0 is January 1st).

Parameters
wYearThe year.
wMonthThe month.
wDayThe day.
wDays[output] The day number within the year.
Returns
TRUE – Success, FALSE – Failure

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.

◆ GetDaysOfMonth()

WORD SCalendarCore::GetDaysOfMonth ( WORD wYear,
WORD wMonth )
static

Returns the number of days in a specified month.

Parameters
wYearThe year.
wMonthThe month.
Returns
Returns the number of days in the month, returns 0 if the month/year is invalid.

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.

◆ IsLeapYear()

BOOL SCalendarCore::IsLeapYear ( WORD wYear,
BOOL & bLeapYear )
static

Determines if a year is a leap year.

Parameters
wYearThe year to check.
bLeapYear[output] TRUE if leap year, FALSE if common year.
Returns
TRUE – Success, FALSE – Failure

Checks if the given year is a leap year. Note: Valid range is (1600 to 6999).

Definition at line 46 of file SCalendar.cpp.


The documentation for this class was generated from the following files: