summaryrefslogtreecommitdiff
path: root/Handler/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Handler/Common.hs')
-rw-r--r--Handler/Common.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Handler/Common.hs b/Handler/Common.hs
index a1ae34b..aacab92 100644
--- a/Handler/Common.hs
+++ b/Handler/Common.hs
@@ -11,6 +11,7 @@ module Handler.Common
11 , FormState(..) 11 , FormState(..)
12 , HasFormState(..) 12 , HasFormState(..)
13 , stockSort, referenceSort 13 , stockSort, referenceSort
14 , humanId
14 ) where 15 ) where
15 16
16import Import 17import Import
@@ -28,6 +29,12 @@ import Handler.Common.Types
28 29
29import Text.Julius (RawJS(..)) 30import Text.Julius (RawJS(..))
30 31
32import qualified Codec.Crockford as Crockford (encode)
33import Database.Persist.Sql (fromSqlKey)
34
35humanId :: ItemId -> String
36humanId = Crockford.encode . fromSqlKey
37
31dayFormat :: Day -> String 38dayFormat :: Day -> String
32dayFormat = formatTime defaultTimeLocale "%e. %b %y" 39dayFormat = formatTime defaultTimeLocale "%e. %b %y"
33 40