Commit 3f44f492 authored by Nicolas Peifer's avatar Nicolas Peifer

print timestamp above book listing

parent 0544c00a
......@@ -13,11 +13,10 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
......@@ -106,7 +105,7 @@ public class HtmlWriter {
// write opening html
bw.write(FileUtil.readFile(templateDir + File.separator + "opening-tags-template.html"));
bw.write(createNavigationBar(firstLetterOfAuthorList, firstLetterOfAuthor));
bw.write("\n<br><br>\n");
appendTimestamp(bw);
appendTableHeader(bw);
}
// write book in the currently opened html file
......@@ -122,9 +121,9 @@ public class HtmlWriter {
}
}
private void appendFooter(BufferedWriter bw) throws IOException {
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.LONG, Locale.GERMANY);
bw.write("<div style=\"text-align:center\">" + dateFormat.format(new Date()) + "</div>");
private void appendTimestamp(BufferedWriter bw) throws IOException {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy");
bw.write("<div style=\"text-align:right\">Stand: " + dateFormat.format(new Date()) + "</div>");
}
private void appendTableHeader(BufferedWriter bw) throws IOException {
......@@ -195,7 +194,6 @@ public class HtmlWriter {
private void closeCurrentFile(FileOutputStream fos, OutputStreamWriter osw, BufferedWriter bw) throws IOException {
bw.write("</table>");
appendFooter(bw);
bw.write(FileUtil.readFile(templateDir + File.separator + "closing-tags-template.html"));
bw.close();
osw.close();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment