io.bretty.console.table.DateTimeColumnFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of console-table-builder Show documentation
Show all versions of console-table-builder Show documentation
An extensible Java library to build stylish Excel-like tables, which can be converted into a single string with all table formats preserved.
The newest version!
/*
* Copyright (c) 2015 SUN XIMENG (Nathaniel). All rights reserved.
*/
package io.bretty.console.table;
import java.text.DateFormat;
import java.util.Date;
class DateTimeColumnFormatter extends ColumnFormatter {
private DateFormat df;
public DateTimeColumnFormatter(Alignment al, int width, DateFormat df) {
super(al, width);
this.df = df;
}
@Override
public String format(Date d) {
return this.formatString(df.format(d), this.width);
}
}