Skip to content

Commit e564aa8

Browse files
authored
Merge pull request #819 from haskell/qof-bug
Fix bug in FromJSON QuarterOfYear instance
2 parents 45bca74 + f625f49 commit e564aa8

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Data/Aeson/Types/FromJSON.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,11 +2130,11 @@ instance FromJSON QuarterOfYear where
21302130

21312131
parseQuarterOfYear :: T.Text -> Parser QuarterOfYear
21322132
parseQuarterOfYear t = case T.toLower t of
2133-
"q1" -> return Q1
2134-
"q2" -> return Q2
2135-
"q3" -> return Q3
2136-
"e4 " -> return Q4
2137-
_ -> fail "Ivalid quarter of year"
2133+
"q1" -> return Q1
2134+
"q2" -> return Q2
2135+
"q3" -> return Q3
2136+
"q4" -> return Q4
2137+
_ -> fail "Invalid quarter of year"
21382138

21392139
instance FromJSONKey QuarterOfYear where
21402140
fromJSONKey = FromJSONKeyTextParser parseQuarterOfYear

aeson.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: aeson
2-
version: 1.5.5.0
2+
version: 1.5.5.1
33
license: BSD3
44
license-file: LICENSE
55
category: Text, Web, JSON
@@ -235,7 +235,7 @@ test-suite aeson-tests
235235
unordered-containers,
236236
uuid-types,
237237
vector,
238-
quickcheck-instances >= 0.3.24 && <0.4
238+
quickcheck-instances >= 0.3.25.2 && <0.4
239239

240240
if flag(bytestring-builder)
241241
build-depends: bytestring >= 0.9 && < 0.10.4,

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
For the latest version of this document, please see [https://github.com/bos/aeson/blob/master/changelog.md](https://github.com/bos/aeson/blob/master/changelog.md).
22

3+
### 1.5.5.1
4+
* Fix a bug in `FromJSON QuarterOfYear` instance.
5+
36
### 1.5.5.0
47
* Add instances for `Month`, `Quarter` and `QuarterOfYear` (from `time-1.11`), thanks to Oleg Grenrus.
58

0 commit comments

Comments
 (0)