Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2023-10-31 15:48:58 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fdca785ab0ae64528844055a2499b507720397e5
fdca785a
1 parent
cb4b2a21
fix unified coupon expiration date
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponBCHeaderTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponsTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponBCHeaderTableViewCell.swift
View file @
fdca785
...
...
@@ -196,8 +196,9 @@ import AVFoundation
showBarcodeButtonTopSpace
.
constant
=
0
// ===
if
let
earliestExpiration
=
coupon
?
.
_coupons
.
min
(
by
:
{
(
$0
.
expiration
??
""
)
<
(
$1
.
expiration
??
""
)
})
{
expirationLabel
.
text
=
"Το κουπόνι ισχύει έως "
+
(
earliestExpiration
.
expiration
??
""
)
// if let earliestExpiration = coupon?._coupons.min(by: { ($0.expiration ?? "") < ($1.expiration ?? "") }) {
if
let
latestExpiration
=
coupon
?
.
_coupons
.
max
(
by
:
{
(
$0
.
expiration
??
""
)
<
(
$1
.
expiration
??
""
)
})
{
expirationLabel
.
text
=
"Το κουπόνι ισχύει έως "
+
(
latestExpiration
.
expiration
??
""
)
}
else
{
expirationLabel
.
text
=
""
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponsTableViewCell.swift
View file @
fdca785
...
...
@@ -69,8 +69,9 @@ import UIKit
)
// + " αξίας " + String(activeCouponsDiscount) + "€"
if
let
earliestExpiration
=
activeCoupons
.
min
(
by
:
{
(
$0
.
expiration
??
""
)
<
(
$1
.
expiration
??
""
)
})
{
expirationLabel
.
text
=
"Ισχύει έως "
+
(
earliestExpiration
.
expiration
??
""
)
// if let earliestExpiration = activeCoupons.min(by: { ($0.expiration ?? "") < ($1.expiration ?? "") }) {
if
let
latestExpiration
=
activeCoupons
.
max
(
by
:
{
(
$0
.
expiration
??
""
)
<
(
$1
.
expiration
??
""
)
})
{
expirationLabel
.
text
=
"Ισχύει έως "
+
(
latestExpiration
.
expiration
??
""
)
}
else
{
expirationLabel
.
text
=
""
}
...
...
Please
register
or
login
to post a comment