- Inherits from:
- Object
- Conforms to:
- DDatable, DTextable
- Declared in:
- DCalendar.h
Object
|
+---DCalendar
Class Description
The calendar class implements a number of methods for generating calendars.
- Last modified:
- 31-Oct-2007 (DCalendar.h)
Instance Variables
- private int _year
- the year for the calendar
- private int _month
- the month for the calendar (or DCL_ALL_MONTHS)
- Constructors
- - (DCalendar *) init
- Initialise to a default calendar (2003, all months)
- Returns:
- the object
- - (DCalendar *) init :(int) year
- Initialise to an all months calendar for a year
- Parameters:
- year - the year for the calendar
- Returns:
- the object
- - (DCalendar *) init :(int) year :(int) month
- Initialise to a month calendar
- Parameters:
- year - the year for the calendar
month - the month for the calendar
- Returns:
- the object
- First week day methods
- + (int) firstWeekDay
- Get the first week day (initialy DCL_SUNDAY)
- Returns:
- the first week day (DCL_SUNDAY or DCL_MONDAY)
- + (void) firstWeekDay :(int) day
- Set the first week day
- Parameters:
- day - the day number for the first week day (DCL_SUNDAY or DCL_MONDAY)
- Year methods
- + (BOOL) isLeapYear :(int) year
- Check if a year is a leap year
- Parameters:
- year - the year to be checked
- Returns:
- is it ?
- + (int) leapYears :(int) from :(int) to
- Return the number of leap years in a year range
- Parameters:
- from - the start year
to - the last year (incl, to >= from)
- Returns:
- the number of leap years
- - (int) year
- Get the year of the calendar
- Returns:
- the year
- - (DCalendar *) year :(int) year
- Set the year for the calendar
- Parameters:
- year - the year for the calendar
- Returns:
- the object
- Month methods
- + (int) daysInMonth :(int) year :(int) month
- Return the number of days in a month
- Parameters:
- year - the year of the month
month - the month (1..12)
- Returns:
- the number of days in the month (1..31) or (-1)
- - (int) month
- Return the month of the calendar
- Returns:
- the month (or DCL_ALL_MONTHS)
- - (DCalendar *) month :(int) month
- Set the month for the calendar
- Parameters:
- month - the month for the calender (or DCL_ALL_MONTHS)
- Returns:
- the object
- Day methods
- + (int) weekDay :(int) year :(int) month :(int) day
- Return the week day of a date
- Parameters:
- year - the year (1970..)
month - the month (1..12)
day - the day (1..31)
- Returns:
- the week day (DCL_SUNDAY..DCL_SATURDAY)
- Calendar methods
- - (DData *) toData
- Return the calendar in a data string
- Returns:
- a (new) data string with the calendar (7 elements per week, 0 = day outside month)
- - (DText *) toText
- Return the calendar in a text string
- Returns:
- a (new) text string object
generated 05-Nov-2007 by ObjcDoc 3.0.0