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
|
||||
{ fpParse = parseTime
|
||||
, fpRender = show
|
||||
, fpRender = show . roundFullSeconds
|
||||
, fpWidget = \theId name val isReq -> addHamlet
|
||||
[HAMLET|
|
||||
%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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user