From d537aad0439864f4a127428e560dc81870ae7f64 Mon Sep 17 00:00:00 2001 From: Alan Liu Date: Tue, 9 Mar 2004 21:12:49 +0000 Subject: [PATCH] ICU-3391 add UDateFormatField X-SVN-Rev: 14656 --- icu4c/source/i18n/unicode/udat.h | 194 +++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) diff --git a/icu4c/source/i18n/unicode/udat.h b/icu4c/source/i18n/unicode/udat.h index 3a91a7e493b..72b5bc937f9 100644 --- a/icu4c/source/i18n/unicode/udat.h +++ b/icu4c/source/i18n/unicode/udat.h @@ -157,6 +157,200 @@ typedef enum UDateFormatStyle { } UDateFormatStyle; +/** + * UFieldPosition selectors for format fields defined by UDateFormat. + * @draft ICU 3.0 + */ +typedef enum UDateFormatField { + /** + * UFieldPosition selector for 'G' field alignment, + * corresponding to the UCAL_ERA field. + * @draft ICU 3.0 + */ + UDAT_ERA_FIELD = 0, + + /** + * UFieldPosition selector for 'y' field alignment, + * corresponding to the UCAL_YEAR field. + * @draft ICU 3.0 + */ + UDAT_YEAR_FIELD = 1, + + /** + * UFieldPosition selector for 'M' field alignment, + * corresponding to the UCAL_MONTH field. + * @draft ICU 3.0 + */ + UDAT_MONTH_FIELD = 2, + + /** + * UFieldPosition selector for 'd' field alignment, + * corresponding to the UCAL_DATE field. + * @draft ICU 3.0 + */ + UDAT_DATE_FIELD = 3, + + /** + * UFieldPosition selector for 'k' field alignment, + * corresponding to the UCAL_HOUR_OF_DAY field. + * UDAT_HOUR_OF_DAY1_FIELD is used for the one-based 24-hour clock. + * For example, 23:59 + 01:00 results in 24:59. + * @draft ICU 3.0 + */ + UDAT_HOUR_OF_DAY1_FIELD = 4, + + /** + * UFieldPosition selector for 'H' field alignment, + * corresponding to the UCAL_HOUR_OF_DAY field. + * UDAT_HOUR_OF_DAY0_FIELD is used for the zero-based 24-hour clock. + * For example, 23:59 + 01:00 results in 00:59. + * @draft ICU 3.0 + */ + UDAT_HOUR_OF_DAY0_FIELD = 5, + + /** + * UFieldPosition selector for 'm' field alignment, + * corresponding to the UCAL_MINUTE field. + * @draft ICU 3.0 + */ + UDAT_MINUTE_FIELD = 6, + + /** + * UFieldPosition selector for 's' field alignment, + * corresponding to the UCAL_SECOND field. + * @draft ICU 3.0 + */ + UDAT_SECOND_FIELD = 7, + + /** + * UFieldPosition selector for 'S' field alignment, + * corresponding to the UCAL_MILLISECOND field. + * @draft ICU 3.0 + */ + UDAT_MILLISECOND_FIELD = 8, + + /** + * UFieldPosition selector for 'E' field alignment, + * corresponding to the UCAL_DAY_OF_WEEK field. + * @draft ICU 3.0 + */ + UDAT_DAY_OF_WEEK_FIELD = 9, + + /** + * UFieldPosition selector for 'D' field alignment, + * corresponding to the UCAL_DAY_OF_YEAR field. + * @draft ICU 3.0 + */ + UDAT_DAY_OF_YEAR_FIELD = 10, + + /** + * UFieldPosition selector for 'F' field alignment, + * corresponding to the UCAL_DAY_OF_WEEK_IN_MONTH field. + * @draft ICU 3.0 + */ + UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, + + /** + * UFieldPosition selector for 'w' field alignment, + * corresponding to the UCAL_WEEK_OF_YEAR field. + * @draft ICU 3.0 + */ + UDAT_WEEK_OF_YEAR_FIELD = 12, + + /** + * UFieldPosition selector for 'W' field alignment, + * corresponding to the UCAL_WEEK_OF_MONTH field. + * @draft ICU 3.0 + */ + UDAT_WEEK_OF_MONTH_FIELD = 13, + + /** + * UFieldPosition selector for 'a' field alignment, + * corresponding to the UCAL_AM_PM field. + * @draft ICU 3.0 + */ + UDAT_AM_PM_FIELD = 14, + + /** + * UFieldPosition selector for 'h' field alignment, + * corresponding to the UCAL_HOUR field. + * UDAT_HOUR1_FIELD is used for the one-based 12-hour clock. + * For example, 11:30 PM + 1 hour results in 12:30 AM. + * @draft ICU 3.0 + */ + UDAT_HOUR1_FIELD = 15, + + /** + * UFieldPosition selector for 'K' field alignment, + * corresponding to the UCAL_HOUR field. + * UDAT_HOUR0_FIELD is used for the zero-based 12-hour clock. + * For example, 11:30 PM + 1 hour results in 00:30 AM. + * @draft ICU 3.0 + */ + UDAT_HOUR0_FIELD = 16, + + /** + * UFieldPosition selector for 'z' field alignment, + * corresponding to the UCAL_ZONE_OFFSET and + * UCAL_DST_OFFSET fields. + * @draft ICU 3.0 + */ + UDAT_TIMEZONE_FIELD = 17, + + /** + * UFieldPosition selector for 'Y' field alignment, + * corresponding to the UCAL_YEAR_WOY field. + * @draft ICU 3.0 + */ + UDAT_YEAR_WOY_FIELD = 18, + + /** + * UFieldPosition selector for 'e' field alignment, + * corresponding to the UCAL_DOW_LOCAL field. + * @draft ICU 3.0 + */ + UDAT_DOW_LOCAL_FIELD = 19, + + /** + * UFieldPosition selector for 'u' field alignment, + * corresponding to the UCAL_EXTENDED_YEAR field. + * @draft ICU 3.0 + */ + UDAT_EXTENDED_YEAR_FIELD = 20, + + /** + * UFieldPosition selector for 'g' field alignment, + * corresponding to the UCAL_JULIAN_DAY field. + * @draft ICU 3.0 + */ + UDAT_JULIAN_DAY_FIELD = 21, + + /** + * UFieldPosition selector for 'A' field alignment, + * corresponding to the UCAL_MILLISECONDS_IN_DAY field. + * @draft ICU 3.0 + */ + UDAT_MILLISECONDS_IN_DAY_FIELD = 22, + + /** + * UFieldPosition selector for 'Z' field alignment, + * corresponding to the UCAL_ZONE_OFFSET and + * UCAL_DST_OFFSET fields. + * @draft ICU 3.0 + */ + UDAT_TIMEZONE_RFC_FIELD = 23, + + /** + * Number of UFieldPosition selectors for UDateFormat. + * Valid selectors range from 0 to UDAT_FIELD_COUNT-1. + * This value is subject to change if new fields are defined + * in the future. + * @draft ICU 3.0 + */ + UDAT_FIELD_COUNT = 24 + +} UDateFormatField; + /** * Open a new UDateFormat for formatting and parsing dates and times. * A UDateFormat may be used to format dates in calls to \Ref{udat_format},