aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Utils/Date.elm
diff options
context:
space:
mode:
authorJoris2016-04-04 01:27:36 +0200
committerJoris2016-04-04 01:27:36 +0200
commit8cd63a64abafe21378c35c2489d49f24c9ece3c9 (patch)
tree541145481d1492f3e388002d931cb3f8fec0acb2 /src/client/elm/Utils/Date.elm
parent01e4ce0fa7c369996ec4ef3a033d16d6fa0eb715 (diff)
downloadbudget-8cd63a64abafe21378c35c2489d49f24c9ece3c9.tar.gz
budget-8cd63a64abafe21378c35c2489d49f24c9ece3c9.tar.bz2
budget-8cd63a64abafe21378c35c2489d49f24c9ece3c9.zip
Add income list CRUD in user page
Diffstat (limited to 'src/client/elm/Utils/Date.elm')
-rw-r--r--src/client/elm/Utils/Date.elm39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/client/elm/Utils/Date.elm b/src/client/elm/Utils/Date.elm
new file mode 100644
index 0000000..7a245bc
--- /dev/null
+++ b/src/client/elm/Utils/Date.elm
@@ -0,0 +1,39 @@
+module Utils.Date
+ ( monthToNum
+ , numToMonth
+ ) where
+
+import Date exposing (..)
+
+monthToNum : Month -> Int
+monthToNum month =
+ case month of
+ Jan -> 1
+ Feb -> 2
+ Mar -> 3
+ Apr -> 4
+ May -> 5
+ Jun -> 6
+ Jul -> 7
+ Aug -> 8
+ Sep -> 9
+ Oct -> 10
+ Nov -> 11
+ Dec -> 12
+
+numToMonth : Int -> Month
+numToMonth n =
+ case n of
+ 1 -> Jan
+ 2 -> Feb
+ 3 -> Mar
+ 4 -> Apr
+ 5 -> May
+ 6 -> Jun
+ 7 -> Jul
+ 8 -> Aug
+ 9 -> Sep
+ 10 -> Oct
+ 11 -> Nov
+ 12 -> Dec
+ _ -> Jan