All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.bretty.console.table.DateTimeColumnFormatter Maven / Gradle / Ivy

Go to download

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);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy