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
2022-09-05 16:18:18 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9c6c2ef21f6b28995b8becbeaf8243c6bc038ff4
9c6c2ef2
1 parent
d92734be
update CouponItemModel
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
9c6c2ef
...
...
@@ -408,6 +408,7 @@ public class swiftApi {
public
let
name
:
String
?
public
let
image
:
String
?
public
let
expiration
:
String
?
public
let
created
:
String
?
public
let
description
:
String
?
public
let
discount
:
String
?
public
let
coupon
:
String
?
...
...
@@ -438,11 +439,12 @@ public class swiftApi {
let
expirationString
=
dictionary
[
"expiration"
]
as?
String
?
??
""
let
createdString
=
dictionary
[
"created"
]
as?
String
?
??
""
// Example expirationString: Optional(2022-12-05 01:55)
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd
hh
:mm:ss"
dateFormatter
.
dateFormat
=
"yyyy-MM-dd
HH
:mm:ss"
if
let
date
=
dateFormatter
.
date
(
from
:
expirationString
??
""
)
{
dateFormatter
.
dateFormat
=
"dd/MM/yyyy"
let
resultString
=
dateFormatter
.
string
(
from
:
date
)
...
...
@@ -451,6 +453,14 @@ public class swiftApi {
self
.
expiration
=
""
}
if
let
date
=
dateFormatter
.
date
(
from
:
createdString
??
""
)
{
dateFormatter
.
dateFormat
=
"dd/MM/yyyy"
let
resultString
=
dateFormatter
.
string
(
from
:
date
)
self
.
created
=
resultString
}
else
{
self
.
created
=
""
}
}
...
...
Please
register
or
login
to post a comment