Manos Chorianopoulos

CouponViewController expiration fix

...@@ -201,20 +201,10 @@ import UIKit ...@@ -201,20 +201,10 @@ import UIKit
201 subtitleLabel.textColor = UIColor(rgb: 0x000F1E) 201 subtitleLabel.textColor = UIColor(rgb: 0x000F1E)
202 subtitleLabel.text = coupon.couponset_data?._short_description ?? "" 202 subtitleLabel.text = coupon.couponset_data?._short_description ?? ""
203 203
204 - // Expiration — already formatted as "dd/MM/yyyy" by CouponItemModel
205 expirationLabel.font = UIFont(name: "PingLCG-Bold", size: 13) 204 expirationLabel.font = UIFont(name: "PingLCG-Bold", size: 13)
206 expirationLabel.textColor = UIColor(rgb: 0x002430) 205 expirationLabel.textColor = UIColor(rgb: 0x002430)
207 - if let expiration = coupon.expiration, !expiration.isEmpty { 206 + let formattedExpiration = coupon.formattedExpiration(format: "MMMM d, yyyy")
208 - // TODO: FIX date format 207 + expirationLabel.text = formattedExpiration.isEmpty ? "" : "Valid until " + formattedExpiration
209 - expirationLabel.text = "Valid until " + expiration
210 - } else {
211 - expirationLabel.text = ""
212 - }
213 - // if let expiration = coupon.expiration, !expiration.isEmpty {
214 - // expirationLabel.text = "Η προσφορά ισχύει έως " + expiration
215 - // } else {
216 - // expirationLabel.text = ""
217 - // }
218 208
219 // Description — from couponset_data description 209 // Description — from couponset_data description
220 setupExpandableDetails(with: coupon) 210 setupExpandableDetails(with: coupon)
......