/*
*******************************************************************************
-* Copyright (C) 2007-2014, International Business Machines Corporation and
+* Copyright (C) 2007-2016, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
#include "reldtfmt.h"
#include "unicode/datefmt.h"
+#include "unicode/simpleformatter.h"
#include "unicode/smpdtfmt.h"
-#include "unicode/msgfmt.h"
#include "unicode/udisplaycontext.h"
#include "unicode/uchar.h"
#include "unicode/brkiter.h"
fDateTimeFormatter = (SimpleDateFormat*)other.fDateTimeFormatter->clone();
}
if(other.fCombinedFormat != NULL) {
- fCombinedFormat = (MessageFormat*)other.fCombinedFormat->clone();
+ fCombinedFormat = new SimpleFormatter(*other.fCombinedFormat);
}
if (fDatesLen > 0) {
fDates = (URelativeString*) uprv_malloc(sizeof(fDates[0])*fDatesLen);
datePattern.setTo(fDatePattern);
}
UnicodeString combinedPattern;
- Formattable timeDatePatterns[] = { fTimePattern, datePattern };
- fCombinedFormat->format(timeDatePatterns, 2, combinedPattern, pos, status); // pos is ignored by this
+ fCombinedFormat->format(fTimePattern, datePattern, combinedPattern, status);
fDateTimeFormatter->applyPattern(combinedPattern);
fDateTimeFormatter->format(cal,appendTo,pos);
}
-
+
return appendTo;
}
}
}
UnicodeString combinedPattern;
- Formattable timeDatePatterns[] = { fTimePattern, fDatePattern };
- fCombinedFormat->format(timeDatePatterns, 2, combinedPattern, fPos, status); // pos is ignored by this
+ fCombinedFormat->format(fTimePattern, fDatePattern, combinedPattern, status);
fDateTimeFormatter->applyPattern(combinedPattern);
fDateTimeFormatter->parse(modifiedText,cal,pos);
} else if (fTimePattern.isEmpty() || fCombinedFormat == NULL) {
result.setTo(fDatePattern);
} else {
- Formattable timeDatePatterns[] = { fTimePattern, fDatePattern };
- FieldPosition pos;
- fCombinedFormat->format(timeDatePatterns, 2, result, pos, status);
+ fCombinedFormat->format(fTimePattern, fDatePattern, result, status);
}
}
return result;
if (U_SUCCESS(tempStatus) && resStrLen >= patItem1Len && u_strncmp(resStr,patItem1,patItem1Len)==0) {
fCombinedHasDateAtStart = TRUE;
}
- fCombinedFormat = new MessageFormat(UnicodeString(TRUE, resStr, resStrLen), fLocale, tempStatus);
+ fCombinedFormat = new SimpleFormatter(UnicodeString(TRUE, resStr, resStrLen), 2, 2, tempStatus);
}
}