/*
*******************************************************************************
-* Copyright (C) 1996-2013, International Business Machines
+* Copyright (C) 1996-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
UCAL_EXTENDED_YEAR, // UDAT_EXTENDED_YEAR_FIELD = 20
UCAL_JULIAN_DAY, // UDAT_JULIAN_DAY_FIELD = 21
UCAL_MILLISECONDS_IN_DAY, // UDAT_MILLISECONDS_IN_DAY_FIELD = 22
- UCAL_ZONE_OFFSET, // UDAT_TIMEZONE_RFC_FIELD = 23
- // UCAL_DST_OFFSET also
- UCAL_ZONE_OFFSET, // UDAT_TIMEZONE_GENERIC_FIELD = 24
+ UCAL_ZONE_OFFSET, // UDAT_TIMEZONE_RFC_FIELD = 23 (also UCAL_DST_OFFSET)
+ UCAL_ZONE_OFFSET, // UDAT_TIMEZONE_GENERIC_FIELD = 24 (also UCAL_DST_OFFSET)
UCAL_DOW_LOCAL, // UDAT_STANDALONE_DAY_FIELD = 25
UCAL_MONTH, // UDAT_STANDALONE_MONTH_FIELD = 26
UCAL_MONTH, // UDAT_QUARTER_FIELD = 27
UCAL_MONTH, // UDAT_STANDALONE_QUARTER_FIELD = 28
- UCAL_ZONE_OFFSET, // UDAT_TIMEZONE_SPECIAL_FIELD = 29
+ UCAL_ZONE_OFFSET, // UDAT_TIMEZONE_SPECIAL_FIELD = 29 (also UCAL_DST_OFFSET)
UCAL_YEAR, // UDAT_YEAR_NAME_FIELD = 30
- UCAL_FIELD_COUNT, // UDAT_FIELD_COUNT = 31
+ UCAL_ZONE_OFFSET, // UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31 (also UCAL_DST_OFFSET)
+ UCAL_ZONE_OFFSET, // UDAT_TIMEZONE_ISO_FIELD = 32 (also UCAL_DST_OFFSET)
+ UCAL_ZONE_OFFSET, // UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33 (also UCAL_DST_OFFSET)
+ UCAL_EXTENDED_YEAR, // UDAT_RELATED_YEAR_FIELD = 34 (not an exact match)
+ UCAL_FIELD_COUNT, // UDAT_FIELD_COUNT = 35
// UCAL_IS_LEAP_MONTH is not the target of a mapping
};
((DateFormat*)fmt)->setLenient(isLenient);
}
+U_DRAFT UBool U_EXPORT2
+udat_getBooleanAttribute(const UDateFormat* fmt,
+ UDateFormatBooleanAttribute attr,
+ UErrorCode* status)
+{
+ if(U_FAILURE(*status)) return FALSE;
+ return ((DateFormat*)fmt)->getBooleanAttribute(attr, *status);
+ //return FALSE;
+}
+
+U_DRAFT void U_EXPORT2
+udat_setBooleanAttribute(UDateFormat *fmt,
+ UDateFormatBooleanAttribute attr,
+ UBool newValue,
+ UErrorCode* status)
+{
+ if(U_FAILURE(*status)) return;
+ ((DateFormat*)fmt)->setBooleanAttribute(attr, newValue, *status);
+}
+
U_CAPI const UCalendar* U_EXPORT2
udat_getCalendar(const UDateFormat* fmt)
{
res = syms->getQuarters(count, DateFormatSymbols::STANDALONE, DateFormatSymbols::ABBREVIATED);
break;
+ case UADAT_CYCLIC_ZODIAC_NAMES:
+ res = syms->getZodiacNames(count);
+ index = (index > 0)? (index - 1) % 12: 0;
+ break;
+
}
if(index < count) {
syms->getQuarters(count, DateFormatSymbols::STANDALONE, DateFormatSymbols::ABBREVIATED);
break;
- }
+ case UADAT_CYCLIC_ZODIAC_NAMES:
+ syms->getZodiacNames(count);
+ break;
+ }
return count;
}
return ((Format*)fmt)->getLocaleID(type, *status);
}
-
U_CAPI void U_EXPORT2
udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status)
{
- verifyIsSimpleDateFormat(fmt, status);
if (U_FAILURE(*status)) {
return;
}
- ((SimpleDateFormat*)fmt)->setContext(value, *status);
+ ((DateFormat*)fmt)->setContext(value, *status);
+ return;
}
U_CAPI UDisplayContext U_EXPORT2
-udat_getContext(UDateFormat* fmt, UDisplayContextType type, UErrorCode* status)
+udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status)
{
- verifyIsSimpleDateFormat(fmt, status);
if (U_FAILURE(*status)) {
return (UDisplayContext)0;
}
- return ((SimpleDateFormat*)fmt)->getContext(type, *status);
+ return ((const DateFormat*)fmt)->getContext(type, *status);
}