summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2012-02-27 21:54:25 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2012-02-27 21:54:25 +0100
commit7c0b0313d1ac80e2e10c4b20e7f6a291b1ad7a56 (patch)
tree30bfc19216ef452cfc2476bb2435193ec3803f3e /src
parentb59ef4b75504f697d560728007946c3aa95bc3dd (diff)
Book Marx: Format dates more readably.
Diffstat (limited to 'src')
-rw-r--r--src/mulk/benki/book_marx.clj11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mulk/benki/book_marx.clj b/src/mulk/benki/book_marx.clj
index e1f0850..3fc7b32 100644
--- a/src/mulk/benki/book_marx.clj
+++ b/src/mulk/benki/book_marx.clj
@@ -16,7 +16,8 @@
[noir.response :as response]
[noir.session :as session]
hiccup.core)
- (:import [org.jsoup.Jsoup]))
+ (:import [org.jsoup Jsoup]
+ [java.text DateFormat]))
(def bookmark_tags (cq/table :bookmark_tags))
(def bookmarks (cq/table :bookmarks))
@@ -78,7 +79,11 @@
[:a {:href (escape-html (:uri mark))}
(escape-html (:title mark))]]
[:p {:class "bookmark-date-and-owner"}
- [:span {:class "bookmark-date"} (escape-html (:date mark))]
+ [:span {:class "bookmark-date"}
+ (escape-html
+ (.format
+ (DateFormat/getDateTimeInstance DateFormat/FULL DateFormat/FULL)
+ (:date mark)))]
[:span {:class "bookmark-owner"} " by " (escape-html (:first_name mark))]]
[:p {:class "bookmark-description"}
(htmlize-description (:description mark))]])]]))))
@@ -104,7 +109,7 @@
:when (or (.startsWith uri "http://")
(.startsWith uri "https://"))
soup (ignore-errors (slurp uri))
- page (org.jsoup.Jsoup/parse soup)
+ page (Jsoup/parse soup)
title (.select page "title")]
(.text title)))
origin (or origin