projects
/
asciidoctor_to_rss.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed date output
[asciidoctor_to_rss.git]
/
src
/
main
/
java
/
net
/
wpitchoune
/
asciidoctor
/
Main.java
diff --git
a/src/main/java/net/wpitchoune/asciidoctor/Main.java
b/src/main/java/net/wpitchoune/asciidoctor/Main.java
index
43f0a88
..
4cfe7fd
100644
(file)
--- a/
src/main/java/net/wpitchoune/asciidoctor/Main.java
+++ b/
src/main/java/net/wpitchoune/asciidoctor/Main.java
@@
-55,6
+55,10
@@
public class Main {
private static final Asciidoctor asciidoctor = Factory.create();
private static final Asciidoctor asciidoctor = Factory.create();
+ private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-dd-MM");
+
+
+
private static File toHTMLFile(File dir, File adoc) {
int idx;
String name;
private static File toHTMLFile(File dir, File adoc) {
int idx;
String name;
@@
-152,9
+156,6
@@
public class Main {
StringBuffer news;
String itemTitle, itemContent, itemURI, strDate;
Date itemDate;
StringBuffer news;
String itemTitle, itemContent, itemURI, strDate;
Date itemDate;
- SimpleDateFormat sdf;
-
- sdf = new SimpleDateFormat("yyyy-dd-MM");
inDir = new File(args[0]);
outDir = new File(args[1]);
inDir = new File(args[0]);
outDir = new File(args[1]);
@@
-194,7
+195,7
@@
public class Main {
else
strDate = h.getAttributes().get("date").toString();
else
strDate = h.getAttributes().get("date").toString();
- itemDate =
sdf
.parse(strDate);
+ itemDate =
DATE_FORMATTER
.parse(strDate);
asciidoctor.convert(new FileReader(adoc), desc, new HashMap<String,Object>());
asciidoctor.convert(new FileReader(adoc), desc, new HashMap<String,Object>());
@@
-220,7
+221,7
@@
public class Main {
news.append("</h2>");
if (news != null) {
news.append("<div class='date'>");
news.append("</h2>");
if (news != null) {
news.append("<div class='date'>");
- news.append(
itemDate
);
+ news.append(
DATE_FORMATTER.format(itemDate)
);
news.append("</div>");
}
news.append(desc.toString());
news.append("</div>");
}
news.append(desc.toString());