From e44104c8d2b832ab8e023c9b5b31417b77e649d1 Mon Sep 17 00:00:00 2001 From: Alexander Iljin Date: Sat, 22 Apr 2017 21:13:00 +0300 Subject: [PATCH] calendar.format: restore the deleted duration>hm It was replaced with duration>hms, but the version without the seconds is also useful. --- basis/calendar/format/format.factor | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/basis/calendar/format/format.factor b/basis/calendar/format/format.factor index 9506bda581..1c4c685248 100644 --- a/basis/calendar/format/format.factor +++ b/basis/calendar/format/format.factor @@ -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 ) [