Manos Chorianopoulos

fix sharing coupon at AnalysisItemViewCell

...@@ -35,10 +35,21 @@ class AnalysisItemViewCell: UITableViewCell { ...@@ -35,10 +35,21 @@ class AnalysisItemViewCell: UITableViewCell {
35 35
36 extension AnalysisItemViewCell { 36 extension AnalysisItemViewCell {
37 func configureCell(item: swiftApi.SharingCouponModel) { 37 func configureCell(item: swiftApi.SharingCouponModel) {
38 +
39 + let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
40 +
41 + titleLabel.text = ""
42 +
43 + for merchant in merchantList {
44 + if (merchant._uuid == item._merchant_uuid) {
45 + itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
46 + titleLabel.text = merchant._admin_name
47 + break;
48 + }
49 + }
38 50
39 dateLabel.text = item._date 51 dateLabel.text = item._date
40 - //itemImage.image = 52 + // titleLabel.text = item._name
41 - titleLabel.text = item._name
42 53
43 let priceFloat = Float(round(100 * (Float(item._discount) ?? 0.0)) / 100) 54 let priceFloat = Float(round(100 * (Float(item._discount) ?? 0.0)) / 100)
44 var priceString = "0" 55 var priceString = "0"
...@@ -71,7 +82,7 @@ extension AnalysisItemViewCell { ...@@ -71,7 +82,7 @@ extension AnalysisItemViewCell {
71 } 82 }
72 } 83 }
73 84
74 - dateLabel.text = item.expiration ?? "" // TODO: change 85 + dateLabel.text = item.created ?? "" // expiration
75 // itemImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache()) 86 // itemImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
76 // titleLabel.text = couponSetData?.name ?? "" 87 // titleLabel.text = couponSetData?.name ?? ""
77 88
......
...@@ -4338,7 +4338,7 @@ public class swiftApi { ...@@ -4338,7 +4338,7 @@ public class swiftApi {
4338 // Example "date": "Thu, Jun 23 2022 16:24:44", 4338 // Example "date": "Thu, Jun 23 2022 16:24:44",
4339 let dateString = dictionary["date"] as? String? ?? "" 4339 let dateString = dictionary["date"] as? String? ?? ""
4340 let dateFormatter = DateFormatter() 4340 let dateFormatter = DateFormatter()
4341 - // dateFormatter.dateFormat = "yyyy-MM-dd hh:mm:ss" 4341 + dateFormatter.locale = Locale(identifier: "en_US_POSSIX")
4342 dateFormatter.dateFormat = "E, MMM dd yyyy HH:mm:ss" 4342 dateFormatter.dateFormat = "E, MMM dd yyyy HH:mm:ss"
4343 if let date = dateFormatter.date(from: dateString ?? "") { 4343 if let date = dateFormatter.date(from: dateString ?? "") {
4344 dateFormatter.dateFormat = "dd/MM/yyyy" 4344 dateFormatter.dateFormat = "dd/MM/yyyy"
......