Modified:
trunk/src/main/java/net/bigbark/item/Item.java
trunk/src/main/webapp/WEB-INF/tags/ui/article.tag
Log:
Fix date in article list output to be somewhat prettier. Issue still exists
with actual time returned, see:
http://www.pivotaltracker.com/story/show/474608
Modified: trunk/src/main/java/net/bigbark/item/Item.java
==============================================================================
--- trunk/src/main/java/net/bigbark/item/Item.java (original)
+++ trunk/src/main/java/net/bigbark/item/Item.java Sun Mar 8 12:29:43 2009
@@ -28,6 +28,8 @@
import java.util.Collections;
import java.util.Date;
import java.util.List;
+import java.text.DateFormat;
+
@Entity
@Table( name = "item", uniqueConstraints = { @UniqueConstraint(
columnNames = { "url" } ) } )
@@ -255,6 +257,11 @@
public void setCreationDate(Date creationDate) {
this.creationDate = (Date) creationDate.clone();
+ }
+
+ public String getFormattedCreationDate() {
+ return DateFormat.getDateTimeInstance(
+ DateFormat.MEDIUM, DateFormat.SHORT).format(this.creationDate);
}
public int getRecommendationValue() {
Modified: trunk/src/main/webapp/WEB-INF/tags/ui/article.tag
==============================================================================
--- trunk/src/main/webapp/WEB-INF/tags/ui/article.tag (original)
+++ trunk/src/main/webapp/WEB-INF/tags/ui/article.tag Sun Mar 8 12:29:43
2009
@@ -45,7 +45,7 @@
</span>
<span class="author">
- Posted <c:out value="${item.creationDate}"/> on <a
href="${item.feed.homepage}" target="_blank"> <c:out
value="${item.feed.name}"/></a>
+ Posted <c:out value="${item.formattedCreationDate}"/> on <a
href="${item.feed.homepage}" target="_blank"> <c:out
value="${item.feed.name}"/></a>
<br/>
</span>