friendly-time-0.4: Print time information in friendly ways

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Time.Format.Human

Description

Print a UTCTime as "a few seconds ago" or "3 days ago" and similar.

Synopsis

Documentation

humanReadableTime' Source

Arguments

:: UTCTime

current time

-> UTCTime 
-> String 

A pure form, takes current time as an argument

humanReadableTimeI18N' Source

Arguments

:: HumanTimeLocale 
-> UTCTime

current time

-> UTCTime 
-> String 

I18N version of humanReadableTime'

data HumanTimeLocale Source

Constructors

HumanTimeLocale 

Fields

justNow :: String
 
secondsAgo :: Bool -> String -> String
 
oneMinuteAgo :: Bool -> String
 
minutesAgo :: Bool -> String -> String
 
oneHourAgo :: Bool -> String
 
aboutHoursAgo :: Bool -> String -> String
 
at :: Int -> String -> String

Used when time difference is more than 24 hours but less than 5 days. First argument is the day of week of the older time, second is string formatted with dayOfWeekFmt.

daysAgo :: Bool -> String -> String
 
weekAgo :: Bool -> String -> String
 
weeksAgo :: Bool -> String -> String
 
onYear :: String -> String
 
locale :: TimeLocale
 
timeZone :: TimeZone
 
dayOfWeekFmt :: String

Time format used with at member. See Data.Time.Format for details on formatting sequences.

thisYearFmt :: String

Time format used when time difference is less than a year but more than a month. Time formatted using this string will be passed to onYear.

prevYearFmt :: String

Time format used when time difference is at least one year. Time formatted using this string will be passed to onYear.

defaultHumanTimeLocale :: HumanTimeLocale Source

Default human time locale uses English.