git.iko.soy/typeable/bloodhound
on master help sign in
Merge pull request #135 from alistair/date_improvements

Format date as dd-MM-yyyy to support stricter 2.0+

commit5589154aa844e974c7e9aa78439efd8f510ec1ab authorChris Allen <cma@bitemyapp.com> dateTue 30 Aug 2016, 10:10 (10 years ago) parent04157949b9604b
1 file changed+1−4
src/Database/Bloodhound/Types.hs+1−4
src/Database/Bloodhound/Types.hs+1−4
@@ -1917,10 +1917,7 @@ instance ToJSON DateRangeAggRange where
19171917instance ToJSON DateMathExpr where
19181918 toJSON (DateMathExpr a mods) = String (fmtA a <> mconcat (fmtMod <$> mods))
19191919 where fmtA DMNow = "now"
1920− fmtA (DMDate date) = case toGregorian date of
1921− (y,m,d) -> showText y <> "-" <>
1922− showText m <> "-" <>
1923− showText d <> "||"
1920+ fmtA (DMDate date) = (T.pack $ showGregorian date) <> "||"
19241921 fmtMod (AddTime n u) = "+" <> showText n <> fmtU u
19251922 fmtMod (SubtractTime n u) = "-" <> showText n <> fmtU u
19261923 fmtMod (RoundDownTo u) = "/" <> fmtU u