MCalendar can hold date and time value for with different calendar systems.
More...
List of all members.
Detailed Description
MCalendar can hold date and time value for with different calendar systems.
- Note:
- insufficient information: default values are used. e.g. with gregorian calendar the epoch value (1970-1-1)
-
inconsistent information: preference is on fields set more recently
Constructor & Destructor Documentation
Constructs a MCalendar with explicit calendar type.
- Parameters:
-
| calendar | Calendar type. Default is the type used for default locale. |
| timezone | Timezone to be used. Default is timezone of the default locale. Possible values: id, e.g. PST, country/city, e.g. Europe/Helsinki or GMT offset, e.g. GTM+2:00. supportedTimezones() can be used to enumerate choices. |
MCalendar::MCalendar |
( |
const MCalendar & |
other |
) |
|
MCalendar::~MCalendar |
( |
|
) |
[virtual] |
Member Function Documentation
void MCalendar::addDays |
( |
int |
days |
) |
|
Add number of days days to the current date.
void MCalendar::addHours |
( |
int |
hours |
) |
|
Add number of hours hours to the current time.
void MCalendar::addMinutes |
( |
int |
minutes |
) |
|
Add number of minutes minutes to the current time.
void MCalendar::addMonths |
( |
int |
months |
) |
|
Add number of months months to the current date.
void MCalendar::addSeconds |
( |
int |
seconds |
) |
|
Add number of seconds seconds to the current time.
void MCalendar::addYears |
( |
int |
years |
) |
|
Add number of years years to the current date.
bool MCalendar::after |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is after other.
bool MCalendar::before |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is before other.
int MCalendar::dayOfMonth |
( |
|
) |
const |
int MCalendar::dayOfWeek |
( |
|
) |
const |
Returns day of week. Monday = 1.
int MCalendar::dayOfYear |
( |
|
) |
const |
returns day number of the year. returns zero on error.
int MCalendar::daysInWeek |
( |
|
) |
const |
Returns the maximum number of days in a week.
bool MCalendar::equals |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is equal to other.
int MCalendar::firstDayOfMonth |
( |
|
) |
const |
Returns first day of a month.
int MCalendar::firstDayOfWeek |
( |
|
) |
const |
Returns the first day of a week.
int MCalendar::hour |
( |
|
) |
const |
Returns the current hours.
bool MCalendar::isValid |
( |
|
) |
const |
checks the validity of the information of the calendar. Returns true if calendar is valid.
int MCalendar::lastDayOfMonth |
( |
|
) |
const |
Returns last day of a month.
int MCalendar::maximumWeeksInMonth |
( |
|
) |
const |
Returns the maximum number of weeks in a month.
int MCalendar::minimalDaysInFirstWeek |
( |
|
) |
const |
returns the number of days required for the first week in the year
int MCalendar::minute |
( |
|
) |
const |
Returns the current minutes.
int MCalendar::month |
( |
|
) |
const |
bool MCalendar::operator!= |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is different than other.
bool MCalendar::operator< |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is before other.
bool MCalendar::operator<= |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is equal or before other.
bool MCalendar::operator== |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is equal to other.
bool MCalendar::operator> |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is after other.
bool MCalendar::operator>= |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is equal or after other.
QDateTime MCalendar::qDateTime |
( |
Qt::TimeSpec |
spec = Qt::LocalTime |
) |
const |
Converts calendar into QDate.
- Parameters:
-
| spec | (optional) specification for resulting QDateTime, Qt::LocalTime (default) or Qt::UTC |
int MCalendar::second |
( |
|
) |
const |
Returns the current seconds.
void MCalendar::setDate |
( |
int |
year, |
|
|
int |
month, |
|
|
int |
day | |
|
) |
| | |
Sets the calendar date. Parameters self explanatory.
void MCalendar::setDate |
( |
const QDate & |
date |
) |
|
Sets the calendar date from QDate.
void MCalendar::setDateTime |
( |
QDateTime |
datetime |
) |
|
Sets the calendar according to given QDate.
void MCalendar::setDay |
( |
int |
day |
) |
|
Set the day of the date to day.
void MCalendar::setFirstDayOfWeek |
( |
int |
weekday |
) |
|
Sets the first day of the week to weekday.
void MCalendar::setHours |
( |
int |
hours |
) |
|
Set the hours of the date/time to hours.
void MCalendar::setMinimalDaysInFirstWeek |
( |
int |
days |
) |
|
sets what is the required amount of days for the first week of the year.
void MCalendar::setMinutes |
( |
int |
minutes |
) |
|
Set the minutes of the time to minutes.
void MCalendar::setMonth |
( |
int |
month |
) |
|
Set the month of the date to month.
void MCalendar::setSeconds |
( |
int |
seconds |
) |
|
Set the seconds of the time to seconds.
void MCalendar::setSystemTimeZone |
( |
const QString & |
timezone |
) |
[static] |
void MCalendar::setTime |
( |
int |
hours, |
|
|
int |
minutes, |
|
|
int |
seconds | |
|
) |
| | |
Set calendar time of the day.
void MCalendar::setYear |
( |
int |
year |
) |
|
Set the year of the date to year.
QString MCalendar::systemTimeZone |
( |
|
) |
[static] |
returns the used calendar system
int MCalendar::weekNumber |
( |
|
) |
const |
Returns the current week number.
int MCalendar::weekOfYear |
( |
|
) |
const |
Returns week number in the year.
int MCalendar::year |
( |
|
) |
const |
int MCalendar::yearOfWeek |
( |
|
) |
const |
returns the year the current week "belongs to".