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. |
ML10N::MCalendar::MCalendar |
( |
const MCalendar & |
other |
) |
|
ML10N::MCalendar::~MCalendar |
( |
|
) |
[virtual] |
Member Function Documentation
void ML10N::MCalendar::addDays |
( |
int |
days |
) |
|
Add number of days days to the current date.
void ML10N::MCalendar::addHours |
( |
int |
hours |
) |
|
Add number of hours hours to the current time.
void ML10N::MCalendar::addMinutes |
( |
int |
minutes |
) |
|
Add number of minutes minutes to the current time.
void ML10N::MCalendar::addMonths |
( |
int |
months |
) |
|
Add number of months months to the current date.
void ML10N::MCalendar::addSeconds |
( |
int |
seconds |
) |
|
Add number of seconds seconds to the current time.
void ML10N::MCalendar::addYears |
( |
int |
years |
) |
|
Add number of years years to the current date.
bool ML10N::MCalendar::after |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is after other.
bool ML10N::MCalendar::before |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is before other.
int ML10N::MCalendar::dayOfMonth |
( |
|
) |
const |
int ML10N::MCalendar::dayOfWeek |
( |
|
) |
const |
Returns day of week. Monday = 1.
int ML10N::MCalendar::dayOfYear |
( |
|
) |
const |
returns day number of the year. returns zero on error.
int ML10N::MCalendar::daysInWeek |
( |
|
) |
const |
Returns the maximum number of days in a week.
bool ML10N::MCalendar::equals |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is equal to other.
int ML10N::MCalendar::firstDayOfMonth |
( |
|
) |
const |
Returns first day of a month.
int ML10N::MCalendar::firstDayOfWeek |
( |
|
) |
const |
Returns the first day of a week.
returns whether the given day of the week is a weekday, a weekend day, or a day that transitions from one to the other, in this calendar system.
- See also:
- MLocale::WeekdayType
qint32 ML10N::MCalendar::getWeekendTransition |
( |
MLocale::Weekday |
weekday |
) |
const |
returns the time during the day at which the weekend begins or ends in this calendar system.
Returns the milliseconds after midnight at which the weekend begins or ends.
For regular weekdays it returns -1.
- See also:
- getDayOfWeekType() const
int ML10N::MCalendar::hour |
( |
|
) |
const |
Returns the current hours.
bool ML10N::MCalendar::isValid |
( |
|
) |
const |
checks the validity of the information of the calendar. Returns true if calendar is valid.
int ML10N::MCalendar::lastDayOfMonth |
( |
|
) |
const |
Returns last day of a month.
int ML10N::MCalendar::maximumWeeksInMonth |
( |
|
) |
const |
Returns the maximum number of weeks in a month.
int ML10N::MCalendar::minimalDaysInFirstWeek |
( |
|
) |
const |
returns the number of days required for the first week in the year
int ML10N::MCalendar::minute |
( |
|
) |
const |
Returns the current minutes.
int ML10N::MCalendar::month |
( |
|
) |
const |
bool ML10N::MCalendar::operator!= |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is different than other.
bool ML10N::MCalendar::operator< |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is before other.
bool ML10N::MCalendar::operator<= |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is equal or before other.
bool ML10N::MCalendar::operator== |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is equal to other.
bool ML10N::MCalendar::operator> |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is after other.
bool ML10N::MCalendar::operator>= |
( |
const MCalendar & |
other |
) |
const |
Returns true if the current date/time of this calendar is equal or after other.
QDateTime ML10N::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 ML10N::MCalendar::second |
( |
|
) |
const |
Returns the current seconds.
void ML10N::MCalendar::setDate |
( |
int |
year, |
|
|
int |
month, |
|
|
int |
day | |
|
) |
| | |
Sets the calendar date. Parameters self explanatory.
void ML10N::MCalendar::setDate |
( |
const QDate & |
date |
) |
|
Sets the calendar date from QDate.
void ML10N::MCalendar::setDateTime |
( |
QDateTime |
datetime |
) |
|
Sets the calendar according to given QDate.
void ML10N::MCalendar::setDay |
( |
int |
day |
) |
|
Set the day of the date to day.
void ML10N::MCalendar::setFirstDayOfWeek |
( |
int |
weekday |
) |
|
Sets the first day of the week to weekday.
void ML10N::MCalendar::setHours |
( |
int |
hours |
) |
|
Set the hours of the date/time to hours.
void ML10N::MCalendar::setMinimalDaysInFirstWeek |
( |
int |
days |
) |
|
sets what is the required amount of days for the first week of the year.
void ML10N::MCalendar::setMinutes |
( |
int |
minutes |
) |
|
Set the minutes of the time to minutes.
void ML10N::MCalendar::setMonth |
( |
int |
month |
) |
|
Set the month of the date to month.
void ML10N::MCalendar::setSeconds |
( |
int |
seconds |
) |
|
Set the seconds of the time to seconds.
void ML10N::MCalendar::setSystemTimeZone |
( |
const QString & |
timezone |
) |
[static] |
void ML10N::MCalendar::setTime |
( |
int |
hours, |
|
|
int |
minutes, |
|
|
int |
seconds | |
|
) |
| | |
Set calendar time of the day.
void ML10N::MCalendar::setYear |
( |
int |
year |
) |
|
Set the year of the date to year.
QStringList ML10N::MCalendar::supportedTimeZones |
( |
|
) |
[static] |
QString ML10N::MCalendar::systemTimeZone |
( |
|
) |
[static] |
returns the used calendar system
int ML10N::MCalendar::weekNumber |
( |
|
) |
const |
Returns the current week number.
int ML10N::MCalendar::weekOfYear |
( |
|
) |
const |
Returns week number in the year.
int ML10N::MCalendar::year |
( |
|
) |
const |
int ML10N::MCalendar::yearOfWeek |
( |
|
) |
const |
returns the year the current week "belongs to".