reddit: use calendar.elapsed for relative-time.
parent
107de1d36e
commit
8ea621e090
|
@ -1,9 +1,10 @@
|
||||||
! Copyright (C) 2011-2012 John Benediktsson
|
! Copyright (C) 2011-2012 John Benediktsson
|
||||||
! See http://factorcode.org/license.txt for BSD license
|
! See http://factorcode.org/license.txt for BSD license
|
||||||
|
|
||||||
USING: accessors assocs calendar colors.constants colors.hex
|
USING: accessors assocs calendar calendar.elapsed
|
||||||
combinators formatting fry http.client io io.styles json
|
colors.constants colors.hex combinators formatting fry
|
||||||
json.reader kernel make math math.statistics sequences urls ;
|
http.client io io.styles json json.reader kernel make math
|
||||||
|
math.statistics sequences urls ;
|
||||||
|
|
||||||
IN: reddit
|
IN: reddit
|
||||||
|
|
||||||
|
@ -104,8 +105,8 @@ PRIVATE>
|
||||||
[ story>comments-url ] bi write-link
|
[ story>comments-url ] bi write-link
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
"created_utc" of unix-time>timestamp now swap time-
|
"created_utc" of now timestamp>unix-time swap -
|
||||||
duration>hours ", posted %d hours ago" sprintf write-text
|
relative-time ", posted " write-text write-text
|
||||||
]
|
]
|
||||||
[ " by " write-text [ "author" of ] [ story>author-url ] bi write-link nl nl ]
|
[ " by " write-text [ "author" of ] [ story>author-url ] bi write-link nl nl ]
|
||||||
} cleave
|
} cleave
|
||||||
|
|
Loading…
Reference in New Issue