diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-15 20:02:53 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-15 20:15:04 +0100 |
commit | 299731a0cef7462dd8c17bde7ba1a4aeb6f211cd (patch) | |
tree | 1f16b69aac6fa3ffd7e92c7cba04c4ba2f2e256f /Handler/Common.hs | |
parent | 3ed9ec8ca70afb556f75d4e087043f4c67f50974 (diff) | |
download | bar-299731a0cef7462dd8c17bde7ba1a4aeb6f211cd.tar bar-299731a0cef7462dd8c17bde7ba1a4aeb6f211cd.tar.gz bar-299731a0cef7462dd8c17bde7ba1a4aeb6f211cd.tar.bz2 bar-299731a0cef7462dd8c17bde7ba1a4aeb6f211cd.tar.xz bar-299731a0cef7462dd8c17bde7ba1a4aeb6f211cd.zip |
Implement inventory ids
Diffstat (limited to 'Handler/Common.hs')
-rw-r--r-- | Handler/Common.hs | 7 |
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 | ||
16 | import Import | 17 | import Import |
@@ -28,6 +29,12 @@ import Handler.Common.Types | |||
28 | 29 | ||
29 | import Text.Julius (RawJS(..)) | 30 | import Text.Julius (RawJS(..)) |
30 | 31 | ||
32 | import qualified Codec.Crockford as Crockford (encode) | ||
33 | import Database.Persist.Sql (fromSqlKey) | ||
34 | |||
35 | humanId :: ItemId -> String | ||
36 | humanId = Crockford.encode . fromSqlKey | ||
37 | |||
31 | dayFormat :: Day -> String | 38 | dayFormat :: Day -> String |
32 | dayFormat = formatTime defaultTimeLocale "%e. %b %y" | 39 | dayFormat = formatTime defaultTimeLocale "%e. %b %y" |
33 | 40 | ||