|
|
@@ -31,14 +31,25 @@ import com.vaadin.client.ui.grid.Renderer; |
|
|
|
*/ |
|
|
|
public class DateRenderer implements Renderer<Date> { |
|
|
|
|
|
|
|
private DateTimeFormat format = DateTimeFormat |
|
|
|
.getFormat(PredefinedFormat.DATE_TIME_SHORT); |
|
|
|
private DateTimeFormat format; |
|
|
|
|
|
|
|
// Calendar is unavailable for GWT |
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
private TimeZone timeZone = TimeZone.createTimeZone(new Date() |
|
|
|
.getTimezoneOffset()); |
|
|
|
|
|
|
|
public DateRenderer() { |
|
|
|
this(PredefinedFormat.DATE_TIME_SHORT); |
|
|
|
} |
|
|
|
|
|
|
|
public DateRenderer(PredefinedFormat format) { |
|
|
|
this(DateTimeFormat.getFormat(format)); |
|
|
|
} |
|
|
|
|
|
|
|
public DateRenderer(DateTimeFormat format) { |
|
|
|
setFormat(format); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void render(FlyweightCell cell, Date date) { |
|
|
|
String dateStr = format.format(date, timeZone); |