Commit 14f02fab authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Kateryna Kostiuk

conversations: fix time string so year prints correctly

Change-Id: Ia07644ee1ef0e7211bf93e9852c54e38efb55460
Reviewed-by: Kateryna Kostiuk's avatarKateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
parent bbd35a5b
......@@ -301,14 +301,11 @@ class ConversationViewController: UIViewController, UITextFieldDelegate, Storybo
}
} else {
// age: [received 7 days ago, received the previous year[
let day = Calendar.current.component(.day, from: time)
// apply appropriate suffix to day value
let suffix = day == 1 ? "st" : (day == 2 ? "nd" : (day == 3 ? "rd" : "th"))
dateFormatter.dateFormat = "MMM d'\(suffix),' h:mma"
dateFormatter.dateFormat = "MMM d, h:mma"
}
} else {
// age: [received the previous year, inf[
dateFormatter.dateFormat = "MMM d'th yyyy,' h:mma"
dateFormatter.dateFormat = "MMM d, yyyy h:mma"
}
// generate the string containing the message time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment