From 3757e4cb28b4f904fb3516a49eef6cfcb0517cb1 Mon Sep 17 00:00:00 2001 From: shehabic Date: Sun, 3 Jun 2018 02:27:00 +0200 Subject: [PATCH] Adjusting the logic behind showing "Yesterday" --- DateToolsSwift/DateTools/Date+TimeAgo.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DateToolsSwift/DateTools/Date+TimeAgo.swift b/DateToolsSwift/DateTools/Date+TimeAgo.swift index 527d02de..fe81ff84 100644 --- a/DateToolsSwift/DateTools/Date+TimeAgo.swift +++ b/DateToolsSwift/DateTools/Date+TimeAgo.swift @@ -112,7 +112,7 @@ public extension Date { else if (components.day! >= 2) { return self.logicalLocalizedStringFromFormat(format: "%%d %@days ago", value: components.day!) } - else if (isYesterday) { + else if (isYesterday && components.hour! >= 24) { if (numericDates) { return DateToolsLocalizedStrings("1 day ago"); }