]> git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/unicode/datefmt.h
ICU-6.2.8.tar.gz
[apple/icu.git] / icuSources / i18n / unicode / datefmt.h
1 /*
2 ********************************************************************************
3 * Copyright (C) 1997-2004, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ********************************************************************************
6 *
7 * File DATEFMT.H
8 *
9 * Modification History:
10 *
11 * Date Name Description
12 * 02/19/97 aliu Converted from java.
13 * 04/01/97 aliu Added support for centuries.
14 * 07/23/98 stephen JDK 1.2 sync
15 * 11/15/99 weiv Added support for week of year/day of week formatting
16 ********************************************************************************
17 */
18
19 #ifndef DATEFMT_H
20 #define DATEFMT_H
21
22 #include "unicode/utypes.h"
23
24 #if !UCONFIG_NO_FORMATTING
25
26 #include "unicode/udat.h"
27 #include "unicode/calendar.h"
28 #include "unicode/numfmt.h"
29 #include "unicode/format.h"
30 #include "unicode/locid.h"
31
32 U_NAMESPACE_BEGIN
33
34 class TimeZone;
35
36 /**
37 * DateFormat is an abstract class for a family of classes that convert dates and
38 * times from their internal representations to textual form and back again in a
39 * language-independent manner. Converting from the internal representation (milliseconds
40 * since midnight, January 1, 1970) to text is known as "formatting," and converting
41 * from text to millis is known as "parsing." We currently define only one concrete
42 * subclass of DateFormat: SimpleDateFormat, which can handle pretty much all normal
43 * date formatting and parsing actions.
44 * <P>
45 * DateFormat helps you to format and parse dates for any locale. Your code can
46 * be completely independent of the locale conventions for months, days of the
47 * week, or even the calendar format: lunar vs. solar.
48 * <P>
49 * To format a date for the current Locale, use one of the static factory
50 * methods:
51 * <pre>
52 * \code
53 * DateFormat* dfmt = DateFormat::createDateInstance();
54 * UDate myDate = Calendar::getNow();
55 * UnicodeString myString;
56 * myString = dfmt->format( myDate, myString );
57 * \endcode
58 * </pre>
59 * If you are formatting multiple numbers, it is more efficient to get the
60 * format and use it multiple times so that the system doesn't have to fetch the
61 * information about the local language and country conventions multiple times.
62 * <pre>
63 * \code
64 * DateFormat* df = DateFormat::createDateInstance();
65 * UnicodeString myString;
66 * UDate myDateArr[] = { 0.0, 100000000.0, 2000000000.0 }; // test values
67 * for (int32_t i = 0; i < 3; ++i) {
68 * myString.remove();
69 * cout << df->format( myDateArr[i], myString ) << endl;
70 * }
71 * \endcode
72 * </pre>
73 * To get specific fields of a date, you can use UFieldPosition to
74 * get specific fields.
75 * <pre>
76 * \code
77 * DateFormat* dfmt = DateFormat::createDateInstance();
78 * FieldPosition pos(DateFormat::YEAR_FIELD);
79 * UnicodeString myString;
80 * myString = dfmt->format( myDate, myString );
81 * cout << myString << endl;
82 * cout << pos.getBeginIndex() << "," << pos. getEndIndex() << endl;
83 * \endcode
84 * </pre>
85 * To format a date for a different Locale, specify it in the call to
86 * createDateInstance().
87 * <pre>
88 * \code
89 * DateFormat* df =
90 * DateFormat::createDateInstance( DateFormat::SHORT, Locale::getFrance());
91 * \endcode
92 * </pre>
93 * You can use a DateFormat to parse also.
94 * <pre>
95 * \code
96 * UErrorCode status = U_ZERO_ERROR;
97 * UDate myDate = df->parse(myString, status);
98 * \endcode
99 * </pre>
100 * Use createDateInstance() to produce the normal date format for that country.
101 * There are other static factory methods available. Use createTimeInstance()
102 * to produce the normal time format for that country. Use createDateTimeInstance()
103 * to produce a DateFormat that formats both date and time. You can pass in
104 * different options to these factory methods to control the length of the
105 * result; from SHORT to MEDIUM to LONG to FULL. The exact result depends on the
106 * locale, but generally:
107 * <ul type=round>
108 * <li> SHORT is completely numeric, such as 12/13/52 or 3:30pm
109 * <li> MEDIUM is longer, such as Jan 12, 1952
110 * <li> LONG is longer, such as January 12, 1952 or 3:30:32pm
111 * <li> FULL is pretty completely specified, such as
112 * Tuesday, April 12, 1952 AD or 3:30:42pm PST.
113 * </ul>
114 * You can also set the time zone on the format if you wish. If you want even
115 * more control over the format or parsing, (or want to give your users more
116 * control), you can try casting the DateFormat you get from the factory methods
117 * to a SimpleDateFormat. This will work for the majority of countries; just
118 * remember to chck getDynamicClassID() before carrying out the cast.
119 * <P>
120 * You can also use forms of the parse and format methods with ParsePosition and
121 * FieldPosition to allow you to
122 * <ul type=round>
123 * <li> Progressively parse through pieces of a string.
124 * <li> Align any particular field, or find out where it is for selection
125 * on the screen.
126 * </ul>
127 *
128 * <p><em>User subclasses are not supported.</em> While clients may write
129 * subclasses, such code will not necessarily work and will not be
130 * guaranteed to work stably from release to release.
131 */
132 class U_I18N_API DateFormat : public Format {
133 public:
134
135 /**
136 * Constants for various style patterns. These reflect the order of items in
137 * the DateTimePatterns resource. There are 4 time patterns, 4 date patterns,
138 * and then the date-time pattern. Each block of 4 values in the resource occurs
139 * in the order full, long, medium, short.
140 * @stable ICU 2.4
141 */
142 enum EStyle
143 {
144 kNone = -1,
145
146 kFull = 0,
147 kLong = 1,
148 kMedium = 2,
149 kShort = 3,
150
151 kDateOffset = kShort + 1,
152 // kFull + kDateOffset = 4
153 // kLong + kDateOffset = 5
154 // kMedium + kDateOffset = 6
155 // kShort + kDateOffset = 7
156
157 kDateTime = 8,
158
159 kDefault = kMedium,
160
161
162
163 /**
164 * These constants are provided for backwards compatibility only.
165 * Please use the C++ style constants defined above.
166 */
167 FULL = kFull,
168 LONG = kLong,
169 MEDIUM = kMedium,
170 SHORT = kShort,
171 DEFAULT = kDefault,
172 DATE_OFFSET = kDateOffset,
173 NONE = kNone,
174 DATE_TIME = kDateTime
175 };
176
177 /**
178 * Destructor.
179 * @stable ICU 2.0
180 */
181 virtual ~DateFormat();
182
183 /**
184 * Equality operator. Returns true if the two formats have the same behavior.
185 * @stable ICU 2.0
186 */
187 virtual UBool operator==(const Format&) const;
188
189 /**
190 * Format an object to produce a string. This method handles Formattable
191 * objects with a UDate type. If a the Formattable object type is not a Date,
192 * then it returns a failing UErrorCode.
193 *
194 * @param obj The object to format. Must be a Date.
195 * @param appendTo Output parameter to receive result.
196 * Result is appended to existing contents.
197 * @param pos On input: an alignment field, if desired.
198 * On output: the offsets of the alignment field.
199 * @param status Output param filled with success/failure status.
200 * @return Reference to 'appendTo' parameter.
201 * @stable ICU 2.0
202 */
203 virtual UnicodeString& format(const Formattable& obj,
204 UnicodeString& appendTo,
205 FieldPosition& pos,
206 UErrorCode& status) const;
207
208 /**
209 * Formats a date into a date/time string. This is an abstract method which
210 * concrete subclasses must implement.
211 * <P>
212 * On input, the FieldPosition parameter may have its "field" member filled with
213 * an enum value specifying a field. On output, the FieldPosition will be filled
214 * in with the text offsets for that field.
215 * <P> For example, given a time text
216 * "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is
217 * UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and
218 * statfieldPositionus.getEndIndex will be set to 0 and 4, respectively.
219 * <P> Notice
220 * that if the same time field appears more than once in a pattern, the status will
221 * be set for the first occurence of that time field. For instance,
222 * formatting a UDate to the time string "1 PM PDT (Pacific Daylight Time)"
223 * using the pattern "h a z (zzzz)" and the alignment field
224 * DateFormat::TIMEZONE_FIELD, the offsets fieldPosition.beginIndex and
225 * fieldPosition.getEndIndex will be set to 5 and 8, respectively, for the first
226 * occurence of the timezone pattern character 'z'.
227 *
228 * @param cal Calendar set to the date and time to be formatted
229 * into a date/time string.
230 * @param appendTo Output parameter to receive result.
231 * Result is appended to existing contents.
232 * @param fieldPosition On input: an alignment field, if desired (see examples above)
233 * On output: the offsets of the alignment field (see examples above)
234 * @return Reference to 'appendTo' parameter.
235 * @stable ICU 2.1
236 */
237 virtual UnicodeString& format( Calendar& cal,
238 UnicodeString& appendTo,
239 FieldPosition& fieldPosition) const = 0;
240
241 /**
242 * Formats a UDate into a date/time string.
243 * <P>
244 * On input, the FieldPosition parameter may have its "field" member filled with
245 * an enum value specifying a field. On output, the FieldPosition will be filled
246 * in with the text offsets for that field.
247 * <P> For example, given a time text
248 * "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is
249 * UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and
250 * statfieldPositionus.getEndIndex will be set to 0 and 4, respectively.
251 * <P> Notice
252 * that if the same time field appears more than once in a pattern, the status will
253 * be set for the first occurence of that time field. For instance,
254 * formatting a UDate to the time string "1 PM PDT (Pacific Daylight Time)"
255 * using the pattern "h a z (zzzz)" and the alignment field
256 * DateFormat::TIMEZONE_FIELD, the offsets fieldPosition.beginIndex and
257 * fieldPosition.getEndIndex will be set to 5 and 8, respectively, for the first
258 * occurence of the timezone pattern character 'z'.
259 *
260 * @param date UDate to be formatted into a date/time string.
261 * @param appendTo Output parameter to receive result.
262 * Result is appended to existing contents.
263 * @param fieldPosition On input: an alignment field, if desired (see examples above)
264 * On output: the offsets of the alignment field (see examples above)
265 * @return Reference to 'appendTo' parameter.
266 * @stable ICU 2.0
267 */
268 UnicodeString& format( UDate date,
269 UnicodeString& appendTo,
270 FieldPosition& fieldPosition) const;
271
272 /**
273 * Formats a UDate into a date/time string. If there is a problem, you won't
274 * know, using this method. Use the overloaded format() method which takes a
275 * FieldPosition& to detect formatting problems.
276 *
277 * @param date The UDate value to be formatted into a string.
278 * @param appendTo Output parameter to receive result.
279 * Result is appended to existing contents.
280 * @return Reference to 'appendTo' parameter.
281 * @stable ICU 2.0
282 */
283 UnicodeString& format(UDate date, UnicodeString& appendTo) const;
284
285 /**
286 * Redeclared Format method.
287 *
288 * @param obj The object to be formatted into a string.
289 * @param appendTo Output parameter to receive result.
290 * Result is appended to existing contents.
291 * @param status Output param filled with success/failure status.
292 * @return Reference to 'appendTo' parameter.
293 * @stable ICU 2.0
294 */
295 UnicodeString& format(const Formattable& obj,
296 UnicodeString& appendTo,
297 UErrorCode& status) const;
298
299 /**
300 * Parse a date/time string.
301 *
302 * @param text The string to be parsed into a UDate value.
303 * @param status Output param to be set to success/failure code. If
304 * 'text' cannot be parsed, it will be set to a failure
305 * code.
306 * @result The parsed UDate value, if successful.
307 * @stable ICU 2.0
308 */
309 virtual UDate parse( const UnicodeString& text,
310 UErrorCode& status) const;
311
312 /**
313 * Parse a date/time string beginning at the given parse position. For
314 * example, a time text "07/10/96 4:5 PM, PDT" will be parsed into a Date
315 * that is equivalent to Date(837039928046).
316 * <P>
317 * By default, parsing is lenient: If the input is not in the form used by
318 * this object's format method but can still be parsed as a date, then the
319 * parse succeeds. Clients may insist on strict adherence to the format by
320 * calling setLenient(false).
321 *
322 * @see DateFormat::setLenient(boolean)
323 *
324 * @param text The date/time string to be parsed
325 * @param cal a Calendar set to the date and time to be formatted
326 * into a date/time string.
327 * @param pos On input, the position at which to start parsing; on
328 * output, the position at which parsing terminated, or the
329 * start position if the parse failed.
330 * @return A valid UDate if the input could be parsed.
331 * @stable ICU 2.1
332 */
333 virtual void parse( const UnicodeString& text,
334 Calendar& cal,
335 ParsePosition& pos) const = 0;
336
337 /**
338 * Parse a date/time string beginning at the given parse position. For
339 * example, a time text "07/10/96 4:5 PM, PDT" will be parsed into a Date
340 * that is equivalent to Date(837039928046).
341 * <P>
342 * By default, parsing is lenient: If the input is not in the form used by
343 * this object's format method but can still be parsed as a date, then the
344 * parse succeeds. Clients may insist on strict adherence to the format by
345 * calling setLenient(false).
346 *
347 * @see DateFormat::setLenient(boolean)
348 *
349 * @param text The date/time string to be parsed
350 * @param pos On input, the position at which to start parsing; on
351 * output, the position at which parsing terminated, or the
352 * start position if the parse failed.
353 * @return A valid UDate if the input could be parsed.
354 * @stable ICU 2.0
355 */
356 UDate parse( const UnicodeString& text,
357 ParsePosition& pos) const;
358
359 /**
360 * Parse a string to produce an object. This methods handles parsing of
361 * date/time strings into Formattable objects with UDate types.
362 * <P>
363 * Before calling, set parse_pos.index to the offset you want to start
364 * parsing at in the source. After calling, parse_pos.index is the end of
365 * the text you parsed. If error occurs, index is unchanged.
366 * <P>
367 * When parsing, leading whitespace is discarded (with a successful parse),
368 * while trailing whitespace is left as is.
369 * <P>
370 * See Format::parseObject() for more.
371 *
372 * @param source The string to be parsed into an object.
373 * @param result Formattable to be set to the parse result.
374 * If parse fails, return contents are undefined.
375 * @param parse_pos The position to start parsing at. Upon return
376 * this param is set to the position after the
377 * last character successfully parsed. If the
378 * source is not parsed successfully, this param
379 * will remain unchanged.
380 * @return A newly created Formattable* object, or NULL
381 * on failure. The caller owns this and should
382 * delete it when done.
383 * @stable ICU 2.0
384 */
385 virtual void parseObject(const UnicodeString& source,
386 Formattable& result,
387 ParsePosition& parse_pos) const;
388
389 /**
390 * Create a default date/time formatter that uses the SHORT style for both
391 * the date and the time.
392 *
393 * @return A date/time formatter which the caller owns.
394 * @stable ICU 2.0
395 */
396 static DateFormat* U_EXPORT2 createInstance(void);
397
398 /**
399 * Creates a time formatter with the given formatting style for the given
400 * locale.
401 *
402 * @param style The given formatting style. For example,
403 * SHORT for "h:mm a" in the US locale.
404 * @param aLocale The given locale.
405 * @return A time formatter which the caller owns.
406 * @stable ICU 2.0
407 */
408 static DateFormat* U_EXPORT2 createTimeInstance(EStyle style = kDefault,
409 const Locale& aLocale = Locale::getDefault());
410
411 /**
412 * Creates a date formatter with the given formatting style for the given
413 * const locale.
414 *
415 * @param style The given formatting style. For example,
416 * SHORT for "M/d/yy" in the US locale.
417 * @param aLocale The given locale.
418 * @return A date formatter which the caller owns.
419 * @stable ICU 2.0
420 */
421 static DateFormat* U_EXPORT2 createDateInstance(EStyle style = kDefault,
422 const Locale& aLocale = Locale::getDefault());
423
424 /**
425 * Creates a date/time formatter with the given formatting styles for the
426 * given locale.
427 *
428 * @param dateStyle The given formatting style for the date portion of the result.
429 * For example, SHORT for "M/d/yy" in the US locale.
430 * @param timeStyle The given formatting style for the time portion of the result.
431 * For example, SHORT for "h:mm a" in the US locale.
432 * @param aLocale The given locale.
433 * @return A date/time formatter which the caller owns.
434 * @stable ICU 2.0
435 */
436 static DateFormat* U_EXPORT2 createDateTimeInstance(EStyle dateStyle = kDefault,
437 EStyle timeStyle = kDefault,
438 const Locale& aLocale = Locale::getDefault());
439
440 /**
441 * Gets the set of locales for which DateFormats are installed.
442 * @param count Filled in with the number of locales in the list that is returned.
443 * @return the set of locales for which DateFormats are installed. The caller
444 * does NOT own this list and must not delete it.
445 * @stable ICU 2.0
446 */
447 static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
448
449 /**
450 * Returns true if the formatter is set for lenient parsing.
451 * @stable ICU 2.0
452 */
453 virtual UBool isLenient(void) const;
454
455 /**
456 * Specify whether or not date/time parsing is to be lenient. With lenient
457 * parsing, the parser may use heuristics to interpret inputs that do not
458 * precisely match this object's format. With strict parsing, inputs must
459 * match this object's format.
460 *
461 * @param lenient True specifies date/time interpretation to be lenient.
462 * @see Calendar::setLenient
463 * @stable ICU 2.0
464 */
465 virtual void setLenient(UBool lenient);
466
467 /**
468 * Gets the calendar associated with this date/time formatter.
469 * @return the calendar associated with this date/time formatter.
470 * @stable ICU 2.0
471 */
472 virtual const Calendar* getCalendar(void) const;
473
474 /**
475 * Set the calendar to be used by this date format. Initially, the default
476 * calendar for the specified or default locale is used. The caller should
477 * not delete the Calendar object after it is adopted by this call.
478 * Adopting a new calendar will change to the default symbols.
479 *
480 * @param calendarToAdopt Calendar object to be adopted.
481 * @stable ICU 2.0
482 */
483 virtual void adoptCalendar(Calendar* calendarToAdopt);
484
485 /**
486 * Set the calendar to be used by this date format. Initially, the default
487 * calendar for the specified or default locale is used.
488 *
489 * @param newCalendar Calendar object to be set.
490 * @stable ICU 2.0
491 */
492 virtual void setCalendar(const Calendar& newCalendar);
493
494
495 /**
496 * Gets the number formatter which this date/time formatter uses to format
497 * and parse the numeric portions of the pattern.
498 * @return the number formatter which this date/time formatter uses.
499 * @stable ICU 2.0
500 */
501 virtual const NumberFormat* getNumberFormat(void) const;
502
503 /**
504 * Allows you to set the number formatter. The caller should
505 * not delete the NumberFormat object after it is adopted by this call.
506 * @param formatToAdopt NumberFormat object to be adopted.
507 * @stable ICU 2.0
508 */
509 virtual void adoptNumberFormat(NumberFormat* formatToAdopt);
510
511 /**
512 * Allows you to set the number formatter.
513 * @param newNumberFormat NumberFormat object to be set.
514 * @stable ICU 2.0
515 */
516 virtual void setNumberFormat(const NumberFormat& newNumberFormat);
517
518 /**
519 * Returns a reference to the TimeZone used by this DateFormat's calendar.
520 * @return the time zone associated with the calendar of DateFormat.
521 * @stable ICU 2.0
522 */
523 virtual const TimeZone& getTimeZone(void) const;
524
525 /**
526 * Sets the time zone for the calendar of this DateFormat object. The caller
527 * no longer owns the TimeZone object and should not delete it after this call.
528 * @param zoneToAdopt the TimeZone to be adopted.
529 * @stable ICU 2.0
530 */
531 virtual void adoptTimeZone(TimeZone* zoneToAdopt);
532
533 /**
534 * Sets the time zone for the calendar of this DateFormat object.
535 * @param zone the new time zone.
536 * @stable ICU 2.0
537 */
538 virtual void setTimeZone(const TimeZone& zone);
539
540 protected:
541 /**
542 * Default constructor. Creates a DateFormat with no Calendar or NumberFormat
543 * associated with it. This constructor depends on the subclasses to fill in
544 * the calendar and numberFormat fields.
545 * @stable ICU 2.0
546 */
547 DateFormat();
548
549 /**
550 * Copy constructor.
551 * @stable ICU 2.0
552 */
553 DateFormat(const DateFormat&);
554
555 /**
556 * Default assignment operator.
557 * @stable ICU 2.0
558 */
559 DateFormat& operator=(const DateFormat&);
560
561 /**
562 * The calendar that DateFormat uses to produce the time field values needed
563 * to implement date/time formatting. Subclasses should generally initialize
564 * this to the default calendar for the locale associated with this DateFormat.
565 * @stable ICU 2.4
566 */
567 Calendar* fCalendar;
568
569 /**
570 * The number formatter that DateFormat uses to format numbers in dates and
571 * times. Subclasses should generally initialize this to the default number
572 * format for the locale associated with this DateFormat.
573 * @stable ICU 2.4
574 */
575 NumberFormat* fNumberFormat;
576
577 private:
578 /**
579 * Gets the date/time formatter with the given formatting styles for the
580 * given locale.
581 * @param dateStyle the given date formatting style.
582 * @param timeStyle the given time formatting style.
583 * @param inLocale the given locale.
584 * @return a date/time formatter, or 0 on failure.
585 */
586 static DateFormat* U_EXPORT2 create(EStyle timeStyle, EStyle dateStyle, const Locale&);
587
588 public:
589 /**
590 * Field selector for FieldPosition for DateFormat fields.
591 * @obsolete ICU 3.4 use UDateFormatField instead, since this API will be
592 * removed in that release
593 */
594 enum EField
595 {
596 // Obsolete; use UDateFormatField instead
597 kEraField = UDAT_ERA_FIELD,
598 kYearField = UDAT_YEAR_FIELD,
599 kMonthField = UDAT_MONTH_FIELD,
600 kDateField = UDAT_DATE_FIELD,
601 kHourOfDay1Field = UDAT_HOUR_OF_DAY1_FIELD,
602 kHourOfDay0Field = UDAT_HOUR_OF_DAY0_FIELD,
603 kMinuteField = UDAT_MINUTE_FIELD,
604 kSecondField = UDAT_SECOND_FIELD,
605 kMillisecondField = UDAT_FRACTIONAL_SECOND_FIELD,
606 kDayOfWeekField = UDAT_DAY_OF_WEEK_FIELD,
607 kDayOfYearField = UDAT_DAY_OF_YEAR_FIELD,
608 kDayOfWeekInMonthField = UDAT_DAY_OF_WEEK_IN_MONTH_FIELD,
609 kWeekOfYearField = UDAT_WEEK_OF_YEAR_FIELD,
610 kWeekOfMonthField = UDAT_WEEK_OF_MONTH_FIELD,
611 kAmPmField = UDAT_AM_PM_FIELD,
612 kHour1Field = UDAT_HOUR1_FIELD,
613 kHour0Field = UDAT_HOUR0_FIELD,
614 kTimezoneField = UDAT_TIMEZONE_FIELD,
615 kYearWOYField = UDAT_YEAR_WOY_FIELD,
616 kDOWLocalField = UDAT_DOW_LOCAL_FIELD,
617 kExtendedYearField = UDAT_EXTENDED_YEAR_FIELD,
618 kJulianDayField = UDAT_JULIAN_DAY_FIELD,
619 kMillisecondsInDayField = UDAT_MILLISECONDS_IN_DAY_FIELD,
620
621 // Obsolete; use UDateFormatField instead
622 ERA_FIELD = UDAT_ERA_FIELD,
623 YEAR_FIELD = UDAT_YEAR_FIELD,
624 MONTH_FIELD = UDAT_MONTH_FIELD,
625 DATE_FIELD = UDAT_DATE_FIELD,
626 HOUR_OF_DAY1_FIELD = UDAT_HOUR_OF_DAY1_FIELD,
627 HOUR_OF_DAY0_FIELD = UDAT_HOUR_OF_DAY0_FIELD,
628 MINUTE_FIELD = UDAT_MINUTE_FIELD,
629 SECOND_FIELD = UDAT_SECOND_FIELD,
630 MILLISECOND_FIELD = UDAT_FRACTIONAL_SECOND_FIELD,
631 DAY_OF_WEEK_FIELD = UDAT_DAY_OF_WEEK_FIELD,
632 DAY_OF_YEAR_FIELD = UDAT_DAY_OF_YEAR_FIELD,
633 DAY_OF_WEEK_IN_MONTH_FIELD = UDAT_DAY_OF_WEEK_IN_MONTH_FIELD,
634 WEEK_OF_YEAR_FIELD = UDAT_WEEK_OF_YEAR_FIELD,
635 WEEK_OF_MONTH_FIELD = UDAT_WEEK_OF_MONTH_FIELD,
636 AM_PM_FIELD = UDAT_AM_PM_FIELD,
637 HOUR1_FIELD = UDAT_HOUR1_FIELD,
638 HOUR0_FIELD = UDAT_HOUR0_FIELD,
639 TIMEZONE_FIELD = UDAT_TIMEZONE_FIELD
640 };
641 };
642
643 inline UnicodeString&
644 DateFormat::format(const Formattable& obj,
645 UnicodeString& appendTo,
646 UErrorCode& status) const {
647 return Format::format(obj, appendTo, status);
648 }
649 U_NAMESPACE_END
650
651 #endif /* #if !UCONFIG_NO_FORMATTING */
652
653 #endif // _DATEFMT
654 //eof