Based on humanReadableTimeDiff found in
https://github.com/snoyberg/haskellers/blob/master/Haskellers.hs,
https://github.com/snoyberg/haskellers/blob/master/LICENSE
Modulefriendly-time-0.4.1Haskell2010
Data.Time.Format.Human
Print a UTCTime as "a few seconds ago" or "3 days ago" and similar.
- 1 type
- 5 values
- Packagefriendly-time-0.4.1
- Exports6
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceHuman.hs
A pure form, takes current time as an argument
I18N version of humanReadableTime
I18N version of humanReadableTime'
Constructors
HumanTimeLocalejustNow :: StringsecondsAgo :: Bool -> String -> StringoneMinuteAgo :: Bool -> StringminutesAgo :: Bool -> String -> StringoneHourAgo :: Bool -> StringaboutHoursAgo :: Bool -> String -> Stringat :: Int -> String -> StringUsed 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 -> StringweekAgo :: Bool -> String -> StringweeksAgo :: Bool -> String -> StringonYear :: String -> Stringlocale :: TimeLocaletimeZone :: TimeZonedayOfWeekFmt :: StringTime format used with at member. See
Data.Time.Formatfor details on formatting sequences.thisYearFmt :: StringTime 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 :: StringTime format used when time difference is at least one year. Time formatted using this string will be passed to onYear.
Default human time locale uses English.