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
2025-07-25 15:57:54 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
360da8f603447c847bfd1725ad4a72e8c8425bfa
360da8f6
1 parent
3e37df9e
fix couponset expiration date format
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/cells/MyRewardsOfferCollectionViewCell/MyRewardsOfferCollectionViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/models/Coupon.swift
SwiftWarplyFramework/SwiftWarplyFramework/cells/MyRewardsOfferCollectionViewCell/MyRewardsOfferCollectionViewCell.swift
View file @
360da8f
...
...
@@ -106,7 +106,7 @@ public class MyRewardsOfferCollectionViewCell: UICollectionViewCell {
subtitleLabel
.
font
=
UIFont
(
name
:
"PingLCG-Regular"
,
size
:
14
)
subtitleLabel
.
textColor
=
UIColor
(
rgb
:
0x00111B
)
expirationLabel
.
text
=
data
.
_expiration_formatted
expirationLabel
.
text
=
"έως "
+
data
.
formattedExpiration
(
format
:
"dd-MM"
)
expirationLabel
.
font
=
UIFont
(
name
:
"PingLCG-Regular"
,
size
:
13
)
expirationLabel
.
textColor
=
UIColor
(
rgb
:
0x00111B
)
...
...
SwiftWarplyFramework/SwiftWarplyFramework/models/Coupon.swift
View file @
360da8f
...
...
@@ -252,6 +252,26 @@ public class CouponSetItemModel {
return
""
}
/// Format expiration date with custom format
/// - Parameter format: DateFormatter format string (e.g., "dd-MM", "dd/MM/yyyy")
/// - Returns: Formatted date string or empty string if invalid
public
func
formattedExpiration
(
format
:
String
)
->
String
{
guard
let
expiration
=
self
.
expiration
,
!
expiration
.
isEmpty
else
{
return
""
}
let
inputFormatter
=
DateFormatter
()
inputFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm"
if
let
date
=
inputFormatter
.
date
(
from
:
expiration
)
{
let
outputFormatter
=
DateFormatter
()
outputFormatter
.
dateFormat
=
format
return
outputFormatter
.
string
(
from
:
date
)
}
return
""
}
}
public
class
RedeemedMerchantDetailsModel
:
Codable
{
...
...
Please
register
or
login
to post a comment