From 7c0b0313d1ac80e2e10c4b20e7f6a291b1ad7a56 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 27 Feb 2012 21:54:25 +0100 Subject: Book Marx: Format dates more readably. --- src/mulk/benki/book_marx.clj | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') 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 -- cgit v1.2.3