Skip to content

Commit

Permalink
Use new Calendar API (#249)
Browse files Browse the repository at this point in the history
Use new Calendar API to add the time separator if two dates are in a different day.
  • Loading branch information
0xpablo authored and diegosanchezr committed Nov 8, 2016
1 parent 34a8552 commit dceee05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ChattoApp/ChattoApp/Source/ChatItemsDemoDecorator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final class ChatItemsDemoDecorator: ChatItemsDecoratorProtocol {
}

if let previousMessage = prev as? MessageModelProtocol {
addTimeSeparator = calendar.compare(currentMessage.date, to: previousMessage.date, toGranularity: Calendar.Component.day) != ComparisonResult.orderedSame
addTimeSeparator = !calendar.isDate(currentMessage.date, inSameDayAs: previousMessage.date)
} else {
addTimeSeparator = true
}
Expand Down

0 comments on commit dceee05

Please sign in to comment.