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:47:20 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6702faeb7e12757420dcc211f2841f36b09b272c
6702faeb
1 parent
2fbbf0d5
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 @
6702fae
...
...
@@ -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 @
6702fae
...
...
@@ -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