Date
struct Date : ReferenceConvertible, Comparable, Equatable
-
Pretty prints time ago since the date until now like
An hour ago
- parameter numericDates: tells wether it has to give strings like1 day ago
instead ofYesterday
. - parameter inTerm: tells wich terms sould be displayed correctly instead ofLong ago
- returns: the string representationDeclaration
Swift
func timeAgoSinceDate(numericDates: Bool, inTerm term: TimeTerm = .long) -> StringParameters
numericDatestells wether it has to give strings like “1 day ago” instead of “Yesterday”.
inTermtells wich terms sould be displayed correctly instead of “Long ago”
Return Value
the string representation
View on GitHub
Date Extension Reference