From 8f8bff7b7688f672025468de2b9a2920b7cea391 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 7 Nov 2016 23:01:31 +0100 Subject: [PATCH] Properly format created-at date on icons and images. --- src/uxbox/main/ui/dashboard/icons.cljs | 5 +++-- src/uxbox/main/ui/dashboard/images.cljs | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/uxbox/main/ui/dashboard/icons.cljs b/src/uxbox/main/ui/dashboard/icons.cljs index c02c02787..995dbeaad 100644 --- a/src/uxbox/main/ui/dashboard/icons.cljs +++ b/src/uxbox/main/ui/dashboard/icons.cljs @@ -19,6 +19,7 @@ [uxbox.util.i18n :as t :refer (tr)] [uxbox.util.data :refer (read-string)] [uxbox.util.mixins :as mx :include-macros true] + [uxbox.util.datetime :as dt] [uxbox.util.rstore :as rs] [uxbox.util.schema :as sc] [uxbox.util.lens :as ul] @@ -290,7 +291,7 @@ i/organize]])]))) (mx/defc grid-item - [{:keys [id] :as icon} selected?] + [{:keys [id created-at] :as icon} selected?] (letfn [(toggle-selection [event] (rs/emit! (di/toggle-icon-selection id))) (toggle-selection-shifted [event] @@ -309,7 +310,7 @@ (icon/icon-svg icon)] [:div.item-info [:h3 (:name icon)] - [:span.date "Uploaded at 21/09/2016"]] + (str "Uploaded at " (dt/format created-at "L"))] #_[:div.project-th-actions [:div.project-th-icon.edit i/pencil] [:div.project-th-icon.delete i/trash]]])) diff --git a/src/uxbox/main/ui/dashboard/images.cljs b/src/uxbox/main/ui/dashboard/images.cljs index 7b6c9c95e..0f593d520 100644 --- a/src/uxbox/main/ui/dashboard/images.cljs +++ b/src/uxbox/main/ui/dashboard/images.cljs @@ -18,6 +18,7 @@ [uxbox.main.ui.lightbox :as lbx] [uxbox.main.ui.keyboard :as kbd] [uxbox.main.ui.dashboard.header :refer (header)] + [uxbox.util.datetime :as dt] [uxbox.util.data :as data :refer (read-string)] [uxbox.util.dom :as dom])) @@ -294,7 +295,7 @@ i/organize]])]))) (mx/defc grid-item - [{:keys [id] :as image} selected?] + [{:keys [id created-at] :as image} selected?] (letfn [(toggle-selection [event] (rs/emit! (di/toggle-image-selection id))) (toggle-selection-shifted [event] @@ -312,7 +313,8 @@ [:label {:for (:id image)}]]] [:div.item-info [:h3 (:name image)] - [:span.date "Uploaded at 12/11/2016"]]])) + [:span.date + (str "Uploaded at " (dt/format created-at "L"))]]])) (mx/defc grid {:mixins [mx/static mx/reactive]}