List of usage examples for org.joda.time.format DateTimeFormatter withPivotYear
public DateTimeFormatter withPivotYear(int pivotYear)
From source file:org.wicketopia.joda.util.format.JodaFormatSupport.java
License:Apache License
@SuppressWarnings("unchecked") public String convertToString(T object, Locale locale) { if (object == null) { return ""; }//from ww w . j av a 2 s . co m DateTime dt = translator.toDateTime((T) object); DateTimeFormatter format = formatProvider.getFormatter(); format = format.withPivotYear(pivotYear).withLocale(locale); if (applyTimeZoneDifference) { TimeZone zone = getClientTimeZone(); if (zone != null) { format = format.withZone(DateTimeZone.forTimeZone(zone)); } } return format.print(dt); }