calendar.format: restore the deleted duration>hm

It was replaced with duration>hms, but the version without the seconds is
also useful.
char-rename
Alexander Iljin 2017-04-22 21:13:00 +03:00 committed by Benjamin Pollack
parent 717a49c365
commit e44104c8d2
1 changed files with 5 additions and 3 deletions

View File

@ -187,10 +187,12 @@ TYPED: timestamp>ymdhms ( timestamp: timestamp -- str )
M: timestamp present timestamp>string ;
! Duration formatting
TYPED: duration>hms ( duration: duration -- str )
TYPED: duration>hm ( duration: duration -- str )
[ duration>hours >integer 24 mod pad-00 ]
[ duration>minutes >integer 60 mod pad-00 ]
[ second>> >integer 60 mod pad-00 ] tri 3array ":" join ;
[ duration>minutes >integer 60 mod pad-00 ] bi ":" glue ;
TYPED: duration>hms ( duration: duration -- str )
[ duration>hm ] [ second>> >integer 60 mod pad-00 ] bi ":" glue ;
TYPED: duration>human-readable ( duration: duration -- string )
[