Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

UCalendar Class Reference

Inheritance diagram for UCalendar:

ICU List of all members.

Public Types

typedef double UDate
enum  Type { Traditional, Gregorian }
enum  DateFields {
  Era, Year, Month, WeekOfYear,
  WeekOfMonth, Date, DayOfYear, DayOfWeek,
  DayOfWeekInMonth, AmPm, Hour, HourOfDay,
  Minute, Second, Millisecond, ZoneOffset,
  DstOffset, YearWoy, DowLocal, ExtendedYear,
  JulianDay, MillisecondsInDay, FieldCount, DayOfMonth = Date
}
enum  DaysOfWeek {
  Sunday = 1, Monday, Tuesday, Wednesday,
  Thursday, Friday, Saturday
}
enum  Months {
  January, February, March, April,
  May, June, July, August,
  September, October, November, December,
  UnDecimber
}
enum  AMPMs { AM, PM }
enum  DisplayNameType { Standard, ShortStandard, DST, ShortDST }
enum  Limit {
  Minimum, Maximum, GreatestMinimum, LeastMaximum,
  ActualMinimum, ActualMaximum
}

Public Member Functions

 this (inout UTimeZone zone, inout ULocale locale, Type type=Type.Traditional)
package this (Handle handle)
 ~this ()
void setTimeZone (inout UTimeZone zone)
void getTimeZoneName (UString s, inout ULocale locale, DisplayNameType type=DisplayNameType.Standard)
bool inDaylightTime ()
UDate getNow ()
UDate getMillis ()
void setMillis (UDate date)
void setDate (uint year, Months month, uint date)
void setDateTime (uint year, Months month, uint date, uint hour, uint minute, uint second)
bool isEquivalent (UCalendar when)
bool isEqual (UCalendar when)
bool isBefore (UCalendar when)
bool isAfter (UCalendar when)
void add (DateFields field, uint amount)
void roll (DateFields field, uint amount)
uint get (DateFields field)
void set (DateFields field, uint value)
bool isSet (DateFields field)
void clearField (DateFields field)
void clear ()
uint getLimit (DateFields field, Limit type)
uint getDaysInFirstWeek ()
uint getFirstDayOfWeek ()
void setDaysInFirstWeek (uint value)
void setFirstDayOfWeek (uint value)

Static Public Member Functions

void test ()

Public Attributes

package Handle handle

Private Types

enum  Attribute { Lenient, FirstDayOfWeek, MinimalDaysInFirstWeek }
typedef void * Handle
enum  Error { OK, BufferOverflow = 15 }

Static Private Member Functions

bool isError (Error e)
void testError (Error e, char[] msg)
char * toString (char[] string)
wchar * toString (wchar[] string)
uint length (char *s)
uint length (wchar *s)
char[] toArray (char *s)
wchar[] toArray (wchar *s)

Detailed Description

UCalendar is used for converting between a UDate object and a set of integer fields such as Year, Month, Day, Hour, and so on. (A UDate object represents a specific instant in time with millisecond precision. See UDate for information about the UDate)

Types of UCalendar interpret a UDate according to the rules of a specific calendar system. UCalendar supports Traditional & Gregorian.

A UCalendar object can produce all the time field values needed to implement the date-time formatting for a particular language and calendar style (for example, Japanese-Gregorian, Japanese-Traditional).

When computing a UDate from time fields, two special circumstances may arise: there may be insufficient information to compute the UDate (such as only year and month but no day in the month), or there may be inconsistent information (such as "Tuesday, July 15, 1996" -- July 15, 1996 is actually a Monday).

Insufficient information. The calendar will use default information to specify the missing fields. This may vary by calendar; for the Gregorian calendar, the default for a field is the same as that of the start of the epoch: i.e., Year = 1970, Month = January, Date = 1, etc.

Inconsistent information. If fields conflict, the calendar will give preference to fields set more recently. For example, when determining the day, the calendar will look for one of the following combinations of fields. The most recent combination, as determined by the most recently set single field, will be used.

See http://oss.software.ibm.com/icu/apiref/udat_8h.html for full details.

Definition at line 128 of file UCalendar.d.


Member Typedef Documentation

typedef double UDate
 

Definition at line 132 of file UCalendar.d.

Referenced by getMillis(), getNow(), and setMillis().

typedef void* Handle [protected, inherited]
 

Use this for the primary argument-type to most ICU functions

Definition at line 109 of file ICU.d.


Member Enumeration Documentation

enum Type
 

Enumeration values:
Traditional 
Gregorian 

Definition at line 135 of file UCalendar.d.

enum DateFields
 

Enumeration values:
Era 
Year 
Month 
WeekOfYear 
WeekOfMonth 
Date 
DayOfYear 
DayOfWeek 
DayOfWeekInMonth 
AmPm 
Hour 
HourOfDay 
Minute 
Second 
Millisecond 
ZoneOffset 
DstOffset 
YearWoy 
DowLocal 
ExtendedYear 
JulianDay 
MillisecondsInDay 
FieldCount 
DayOfMonth 

Definition at line 142 of file UCalendar.d.

enum DaysOfWeek
 

Enumeration values:
Sunday 
Monday 
Tuesday 
Wednesday 
Thursday 
Friday 
Saturday 

Definition at line 171 of file UCalendar.d.

enum Months
 

Enumeration values:
January 
February 
March 
April 
May 
June 
July 
August 
September 
October 
November 
December 
UnDecimber 

Definition at line 183 of file UCalendar.d.

enum AMPMs
 

Enumeration values:
AM 
PM 

Definition at line 201 of file UCalendar.d.

enum DisplayNameType
 

Enumeration values:
Standard 
ShortStandard 
DST 
ShortDST 

Definition at line 208 of file UCalendar.d.

enum Limit
 

Enumeration values:
Minimum 
Maximum 
GreatestMinimum 
LeastMaximum 
ActualMinimum 
ActualMaximum 

Definition at line 217 of file UCalendar.d.

enum Attribute [private]
 

Enumeration values:
Lenient 
FirstDayOfWeek 
MinimalDaysInFirstWeek 

Definition at line 228 of file UCalendar.d.

enum Error [protected, inherited]
 

ICU error codes (the ones which are referenced)

Enumeration values:
OK 
BufferOverflow 

Definition at line 117 of file ICU.d.


Constructor & Destructor Documentation

~this  )  [inline]
 

Close this UCalendar

Definition at line 267 of file UCalendar.d.


Member Function Documentation

this inout UTimeZone  zone,
inout ULocale  locale,
Type  type = Type.Traditional
[inline]
 

Open a UCalendar. A UCalendar may be used to convert a millisecond value to a year, month, and day

Definition at line 242 of file UCalendar.d.

References ICU::testError().

package this Handle  handle  )  [inline]
 

Internal only: Open a UCalendar with the given handle

Definition at line 256 of file UCalendar.d.

void setTimeZone inout UTimeZone  zone  )  [inline]
 

Set the TimeZone used by a UCalendar

Definition at line 278 of file UCalendar.d.

References ICU::testError().

void getTimeZoneName UString  s,
inout ULocale  locale,
DisplayNameType  type = DisplayNameType.Standard
[inline]
 

Get display name of the TimeZone used by this UCalendar

Definition at line 292 of file UCalendar.d.

References UString::format(), and ICU::toString().

bool inDaylightTime  )  [inline]
 

Determine if a UCalendar is currently in daylight savings time

Definition at line 309 of file UCalendar.d.

References ICU::testError().

UDate getNow  )  [inline]
 

Get the current date and time

Definition at line 324 of file UCalendar.d.

References UDate.

UDate getMillis  )  [inline]
 

Get a UCalendar's current time in millis. The time is represented as milliseconds from the epoch

Definition at line 336 of file UCalendar.d.

References ICU::testError(), and UDate.

Referenced by isAfter(), isBefore(), and isEqual().

void setMillis UDate  date  )  [inline]
 

Set a UCalendar's current time in millis. The time is represented as milliseconds from the epoch

Definition at line 351 of file UCalendar.d.

References date, ICU::testError(), and UDate.

void setDate uint  year,
Months  month,
uint  date
[inline]
 

Set a UCalendar's current date

Definition at line 365 of file UCalendar.d.

References date, and ICU::testError().

void setDateTime uint  year,
Months  month,
uint  date,
uint  hour,
uint  minute,
uint  second
[inline]
 

Set a UCalendar's current date

Definition at line 379 of file UCalendar.d.

References date, and ICU::testError().

bool isEquivalent UCalendar  when  )  [inline]
 

Returns TRUE if the given Calendar object is equivalent to this one

Definition at line 394 of file UCalendar.d.

References handle.

bool isEqual UCalendar  when  )  [inline]
 

Compares the Calendar time

Definition at line 405 of file UCalendar.d.

References getMillis().

bool isBefore UCalendar  when  )  [inline]
 

Returns true if this Calendar's current time is before "when"'s current time

Definition at line 417 of file UCalendar.d.

References getMillis().

bool isAfter UCalendar  when  )  [inline]
 

Returns true if this Calendar's current time is after "when"'s current time

Definition at line 429 of file UCalendar.d.

References getMillis().

void add DateFields  field,
uint  amount
[inline]
 

Add a specified signed amount to a particular field in a UCalendar

Definition at line 441 of file UCalendar.d.

References ICU::testError().

void roll DateFields  field,
uint  amount
[inline]
 

Add a specified signed amount to a particular field in a UCalendar

Definition at line 456 of file UCalendar.d.

References ICU::testError().

uint get DateFields  field  )  [inline]
 

Get the current value of a field from a UCalendar

Definition at line 470 of file UCalendar.d.

References ICU::testError().

void set DateFields  field,
uint  value
[inline]
 

Set the value of a field in a UCalendar

Definition at line 485 of file UCalendar.d.

bool isSet DateFields  field  )  [inline]
 

Determine if a field in a UCalendar is set

Definition at line 496 of file UCalendar.d.

void clearField DateFields  field  )  [inline]
 

Clear a field in a UCalendar

Definition at line 507 of file UCalendar.d.

void clear  )  [inline]
 

Clear all fields in a UCalendar

Definition at line 518 of file UCalendar.d.

uint getLimit DateFields  field,
Limit  type
[inline]
 

Determine a limit for a field in a UCalendar. A limit is a maximum or minimum value for a field

Definition at line 530 of file UCalendar.d.

References ICU::testError().

uint getDaysInFirstWeek  )  [inline]
 

Definition at line 543 of file UCalendar.d.

uint getFirstDayOfWeek  )  [inline]
 

Definition at line 552 of file UCalendar.d.

void setDaysInFirstWeek uint  value  )  [inline]
 

Definition at line 561 of file UCalendar.d.

void setFirstDayOfWeek uint  value  )  [inline]
 

Definition at line 570 of file UCalendar.d.

void test  )  [inline, static]
 

Definition at line 671 of file UCalendar.d.

Referenced by UCalendar::VersionWin32::this().

bool isError Error  e  )  [inline, static, protected, inherited]
 

Definition at line 127 of file ICU.d.

Referenced by UConverter::detectSignature(), UString::format(), and UConverter::this().

void testError Error  e,
char[]  msg
[inline, static, protected, inherited]
 

Definition at line 145 of file ICU.d.

Referenced by add(), UText::compareFolded(), UConverter::decode(), UConverter::encode(), UResourceBundle::get(), get(), UResourceBundle::getBinary(), UResourceBundle::getInt(), UResourceBundle::getIntVector(), getLimit(), UResourceBundle::getLocale(), getMillis(), UConverter::getName(), UResourceBundle::getNextString(), UResourceBundle::getString(), UDateFormat::getTwoDigitYearStart(), inDaylightTime(), UDateFormat::parse(), roll(), setDate(), setDateTime(), setMillis(), UDecimalFormat::setPattern(), UMessageFormat::setPattern(), setTimeZone(), UDateFormat::setTwoDigitYearStart(), UResourceBundle::this(), UNumberFormat::this(), UMessageFormat::this(), UDateFormat::this(), and this().

char* toString char[]  string  )  [inline, static, protected, inherited]
 

Definition at line 155 of file ICU.d.

Referenced by UConverter::compareNames(), UResourceBundle::getResource(), UResourceBundle::getString(), getTimeZoneName(), UMessageFormat::setLocale(), UResourceBundle::this(), UMessageFormat::this(), UDateFormat::this(), UText::toLower(), ICU::toString(), and UText::toUpper().

wchar* toString wchar[]  string  )  [inline, static, protected, inherited]
 

Definition at line 175 of file ICU.d.

References ICU::toString().

uint length char *  s  )  [inline, static, protected, inherited]
 

Definition at line 184 of file ICU.d.

References strlen().

uint length wchar *  s  )  [inline, static, protected, inherited]
 

Definition at line 193 of file ICU.d.

References wcslen().

char [] toArray char *  s  )  [inline, static, protected, inherited]
 

Definition at line 202 of file ICU.d.

References strlen().

Referenced by UConverter::detectSignature(), UResourceBundle::getKey(), UResourceBundle::getLocale(), UMessageFormat::getLocale(), and UConverter::getName().

wchar [] toArray wchar *  s  )  [inline, static, protected, inherited]
 

Definition at line 213 of file ICU.d.

References wcslen().


Member Data Documentation

package Handle handle
 

Definition at line 130 of file UCalendar.d.

Referenced by isEquivalent(), and UDateFormat::setCalendar().


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:12 2004 for Mango by doxygen 1.3.6