Full second rounding for timeFieldProfile (thanks SealedSun)
This commit is contained in:
parent
79c9e1753a
commit
aa1090d055
@ -88,12 +88,17 @@ dayFieldProfile = FieldProfile
|
|||||||
timeFieldProfile :: FieldProfile sub y TimeOfDay
|
timeFieldProfile :: FieldProfile sub y TimeOfDay
|
||||||
timeFieldProfile = FieldProfile
|
timeFieldProfile = FieldProfile
|
||||||
{ fpParse = parseTime
|
{ fpParse = parseTime
|
||||||
, fpRender = show
|
, fpRender = show . roundFullSeconds
|
||||||
, fpWidget = \theId name val isReq -> addHamlet
|
, fpWidget = \theId name val isReq -> addHamlet
|
||||||
[HAMLET|
|
[HAMLET|
|
||||||
%input#$theId$!name=$name$!:isReq:required!value=$val$
|
%input#$theId$!name=$name$!:isReq:required!value=$val$
|
||||||
|]
|
|]
|
||||||
}
|
}
|
||||||
|
where
|
||||||
|
roundFullSeconds tod =
|
||||||
|
TimeOfDay (todHour tod) (todMin tod) fullSec
|
||||||
|
where
|
||||||
|
fullSec = fromInteger $ floor $ todSec tod
|
||||||
|
|
||||||
htmlFieldProfile :: FieldProfile sub y Html
|
htmlFieldProfile :: FieldProfile sub y Html
|
||||||
htmlFieldProfile = FieldProfile
|
htmlFieldProfile = FieldProfile
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user