Manos Chorianopoulos

fix sharing coupon at AnalysisItemViewCell

......@@ -35,10 +35,21 @@ class AnalysisItemViewCell: UITableViewCell {
extension AnalysisItemViewCell {
func configureCell(item: swiftApi.SharingCouponModel) {
let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
titleLabel.text = ""
for merchant in merchantList {
if (merchant._uuid == item._merchant_uuid) {
itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
titleLabel.text = merchant._admin_name
break;
}
}
dateLabel.text = item._date
//itemImage.image =
titleLabel.text = item._name
// titleLabel.text = item._name
let priceFloat = Float(round(100 * (Float(item._discount) ?? 0.0)) / 100)
var priceString = "0"
......@@ -71,7 +82,7 @@ extension AnalysisItemViewCell {
}
}
dateLabel.text = item.expiration ?? "" // TODO: change
dateLabel.text = item.created ?? "" // expiration
// itemImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
// titleLabel.text = couponSetData?.name ?? ""
......
......@@ -4338,7 +4338,7 @@ public class swiftApi {
// Example "date": "Thu, Jun 23 2022 16:24:44",
let dateString = dictionary["date"] as? String? ?? ""
let dateFormatter = DateFormatter()
// dateFormatter.dateFormat = "yyyy-MM-dd hh:mm:ss"
dateFormatter.locale = Locale(identifier: "en_US_POSSIX")
dateFormatter.dateFormat = "E, MMM dd yyyy HH:mm:ss"
if let date = dateFormatter.date(from: dateString ?? "") {
dateFormatter.dateFormat = "dd/MM/yyyy"
......