Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_INTERNAL void U_EXPORT2 udat_applyPatternRelative ( UDateFormat format,
const UChar datePattern,
int32_t  datePatternLength,
const UChar timePattern,
int32_t  timePatternLength,
UErrorCode status 
)

Set the date & time patterns used by a UDateFormat set for relative date formatting. The patterns should follow the pattern syntax rules.

Parameters:
formatThe formatter to set.
datePatternThe new date pattern
datePatternLengthThe length of datePattern, or -1 if null-terminated.
timePatternThe new time pattern
timePatternLengthThe length of timePattern, or -1 if null-terminated.
statusA pointer to a UErrorCode to receive any errors
See also:
udat_toPatternRelativeDate, udat_toPatternRelativeTime ICU 4.2 technology preview

Definition at line 901 of file udat.cpp.

References U_FAILURE.

{
    verifyIsRelativeDateFormat(format, status);
    if(U_FAILURE(*status)) return;
    const UnicodeString datePat((UBool)(datePatternLength == -1), datePattern, datePatternLength);
    const UnicodeString timePat((UBool)(timePatternLength == -1), timePattern, timePatternLength);
    ((RelativeDateFormat*)format)->applyPatterns(datePat, timePat, *status);
}

Generated by  Doxygen 1.6.0   Back to index