Recognize 'on' for booleans
This commit is contained in:
parent
ed2c67ad79
commit
9af79e4d13
@ -370,6 +370,7 @@ boolField = Field
|
|||||||
"" -> Right Nothing
|
"" -> Right Nothing
|
||||||
"none" -> Right Nothing
|
"none" -> Right Nothing
|
||||||
"yes" -> Right $ Just True
|
"yes" -> Right $ Just True
|
||||||
|
"on" -> Right $ Just True
|
||||||
"no" -> Right $ Just False
|
"no" -> Right $ Just False
|
||||||
t -> Left $ SomeMessage $ MsgInvalidBool t
|
t -> Left $ SomeMessage $ MsgInvalidBool t
|
||||||
showVal = either (\_ -> False)
|
showVal = either (\_ -> False)
|
||||||
@ -393,6 +394,7 @@ checkBoxField = Field
|
|||||||
checkBoxParser [] = Right $ Just False
|
checkBoxParser [] = Right $ Just False
|
||||||
checkBoxParser (x:_) = case x of
|
checkBoxParser (x:_) = case x of
|
||||||
"yes" -> Right $ Just True
|
"yes" -> Right $ Just True
|
||||||
|
"on" -> Right $ Just True
|
||||||
_ -> Right $ Just False
|
_ -> Right $ Just False
|
||||||
|
|
||||||
showVal = either (\_ -> False)
|
showVal = either (\_ -> False)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user