From 299731a0cef7462dd8c17bde7ba1a4aeb6f211cd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Mar 2017 20:02:53 +0100 Subject: Implement inventory ids --- Handler/Common.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Handler/Common.hs') 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 , FormState(..) , HasFormState(..) , stockSort, referenceSort + , humanId ) where import Import @@ -28,6 +29,12 @@ import Handler.Common.Types import Text.Julius (RawJS(..)) +import qualified Codec.Crockford as Crockford (encode) +import Database.Persist.Sql (fromSqlKey) + +humanId :: ItemId -> String +humanId = Crockford.encode . fromSqlKey + dayFormat :: Day -> String dayFormat = formatTime defaultTimeLocale "%e. %b %y" -- cgit v1.2.3