mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix “muted until” date format.
// FREEBIE
This commit is contained in:
parent
0603ab72d0
commit
b2dd458f12
|
@ -403,15 +403,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
NSDate *mutedUntilDate = self.thread.mutedUntilDate;
|
||||
NSDate *now = [NSDate date];
|
||||
if (mutedUntilDate != nil && [mutedUntilDate timeIntervalSinceDate:now] > 0) {
|
||||
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"];
|
||||
NSCalendar *calendar = [NSCalendar currentCalendar];
|
||||
[calendar setTimeZone:timeZone];
|
||||
NSCalendarUnit calendarUnits = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay;
|
||||
NSDateComponents *muteUntilComponents = [calendar components:calendarUnits fromDate:mutedUntilDate];
|
||||
NSDateComponents *nowComponents = [calendar components:calendarUnits fromDate:now];
|
||||
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
||||
dateFormatter.calendar = calendar;
|
||||
dateFormatter.timeZone = timeZone;
|
||||
if (nowComponents.year != muteUntilComponents.year || nowComponents.month != muteUntilComponents.month
|
||||
|| nowComponents.day != muteUntilComponents.day) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue