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:41:00 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
59edf9d73b816364af2eaaa74b1e9fac72c20c7c
59edf9d7
1 parent
9c6c2ef2
fix CouponItemModel
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
59edf9d
...
...
@@ -439,8 +439,6 @@ 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
()
...
...
@@ -453,15 +451,19 @@ public class swiftApi {
self
.
expiration
=
""
}
if
let
date
=
dateFormatter
.
date
(
from
:
createdString
??
""
)
{
dateFormatter
.
dateFormat
=
"dd/MM/yyyy"
let
resultString
=
dateFormatter
.
string
(
from
:
date
)
let
createdString
=
dictionary
[
"created"
]
as?
String
?
??
""
// Example createdString: Optional("2022-08-26 15:20:22.287097")
let
dateFormatter2
=
DateFormatter
()
dateFormatter2
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss.SSSSSS"
if
let
date
=
dateFormatter2
.
date
(
from
:
createdString
??
""
)
{
dateFormatter2
.
dateFormat
=
"dd/MM/yyyy"
let
resultString
=
dateFormatter2
.
string
(
from
:
date
)
self
.
created
=
resultString
}
else
{
self
.
created
=
""
}
}
...
...
Please
register
or
login
to post a comment