]> gitweb.factorcode.org Git - factor.git/commitdiff
calendar.format: restore the deleted duration>hm 1806/head
authorAlexander Iljin <ajsoft@yandex.ru>
Sat, 22 Apr 2017 18:13:00 +0000 (21:13 +0300)
committerBenjamin Pollack <benjamin@bitquabit.com>
Tue, 25 Apr 2017 19:38:51 +0000 (15:38 -0400)
It was replaced with duration>hms, but the version without the seconds is
also useful.

basis/calendar/format/format.factor

index 9506bda581cda08f071f9e4d2693921d3b3ea9e1..1c4c685248c9c533ef27cb7baa6c27de1d80b529 100644 (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 )
     [