@Override public void applyPattern(String pattern) { fIcuSdf.applyPattern(pattern); }
private final StringBuffer fallbackFormat(Calendar fromCalendar, Calendar toCalendar, boolean fromToOnSameDay, StringBuffer appendTo, FieldPosition pos, String fullPattern) { String originalPattern = fDateFormat.toPattern(); fDateFormat.applyPattern(fullPattern); fallbackFormat(fromCalendar, toCalendar, fromToOnSameDay, appendTo, pos); fDateFormat.applyPattern(originalPattern); return appendTo; }
protected SimpleDateFormat getDateFormat(Locale locale) { SimpleDateFormat dateFormat = null; if (this.variant.equals(DATE)) { //dateFormat = I18nSupport.getInstance().getDateFormat(style, locale); dateFormat = (SimpleDateFormat)DateFormat.getDateInstance(style, locale); } else if (this.variant.equals(TIME)) { //dateFormat = I18nSupport.getInstance().getTimeFormat(style, locale); dateFormat = (SimpleDateFormat)DateFormat.getTimeInstance(style, locale); } else if (this.variant.equals(DATE_TIME)) { //dateFormat = I18nSupport.getInstance().getDateTimeFormat(style, style, locale); dateFormat = (SimpleDateFormat)DateFormat.getDateTimeInstance(style, style, locale); } String pattern = (String)localizedPatterns.get(locale); if (pattern != null) // Note: this was previously using applyLocalizedPattern() which allows to use // a locale-specific pattern syntax, e.g. in french "j" (jour) for "d" and // "a" (annee) for "y". But the localized pattern syntax is very little known and thus // led to some weird pattern syntax error messages. dateFormat.applyPattern(pattern); else if (nonLocalizedPattern != null) dateFormat.applyPattern(nonLocalizedPattern); dateFormat.setLenient(lenient); return dateFormat; }
fDateFormat.applyPattern(fTimePattern); if (formatDatePlusTimeRange) { fDateFormat.applyPattern(fDatePattern); StringBuffer datePortion = new StringBuffer(64); otherPos.setBeginIndex(0); if (formatDatePlusTimeRange) { fDateFormat.applyPattern(fullPattern);
fDateTimeFormat.applyPattern(fTimePattern); fDateTimeFormat.format(cal, toAppendTo, fieldPosition); } else if (fTimePattern == null) { toAppendTo.append(relativeDayString); } else { fDateTimeFormat.applyPattern(fDatePattern); fDateTimeFormat.format(cal, toAppendTo, fieldPosition); fDateTimeFormat.applyPattern(combinedPattern.toString()); fDateTimeFormat.format(cal, toAppendTo, fieldPosition);
fDateFormat.applyPattern(intervalPattern.getFirstPart()); fDateFormat.format(firstCal, appendTo, pos); if ( intervalPattern.getSecondPart() != null ) { fDateFormat.applyPattern(intervalPattern.getSecondPart()); FieldPosition otherPos = new FieldPosition(pos.getField()); fDateFormat.format(secondCal, appendTo, otherPos); fDateFormat.applyPattern(originalPattern); return appendTo;