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
2024-03-08 14:41:11 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5798eeb812fa1b909434a2b6263130afa2120166
5798eeb8
1 parent
5b9b6157
CampaignItemModel fix
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
5798eeb
...
...
@@ -1105,6 +1105,8 @@ public class swiftApi {
private
var
category_title
:
String
?
private
var
banner_img
:
String
?
private
var
banner_title
:
String
?
private
var
start_date
:
String
?
private
var
end_date
:
String
?
private
var
unifiedCampaign
:
UnifiedCampaignModel
?
public
init
()
{
...
...
@@ -1132,6 +1134,8 @@ public class swiftApi {
self
.
category_title
=
""
self
.
banner_img
=
""
self
.
banner_title
=
""
self
.
start_date
=
""
self
.
end_date
=
""
self
.
unifiedCampaign
=
swiftApi
.
UnifiedCampaignModel
()
}
...
...
@@ -1150,6 +1154,32 @@ public class swiftApi {
self
.
ccms
=
nil
self
.
unifiedCampaign
=
swiftApi
.
UnifiedCampaignModel
()
let
startDateString
=
dictionary
[
"start_date"
]
as?
String
?
??
""
// Example expirationString: "start_date" = "2022-06-29 00:00:00";
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
if
let
date
=
dateFormatter
.
date
(
from
:
startDateString
??
""
)
{
dateFormatter
.
dateFormat
=
"dd/MM/yyyy"
let
resultString
=
dateFormatter
.
string
(
from
:
date
)
self
.
start_date
=
resultString
}
else
{
self
.
start_date
=
""
}
let
endDateString
=
dictionary
[
"end_date"
]
as?
String
?
??
""
// Example expirationString: "end_date" = "2024-11-30 12:00:00";
let
dateFormatter2
=
DateFormatter
()
dateFormatter2
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
if
let
date
=
dateFormatter2
.
date
(
from
:
endDateString
??
""
)
{
dateFormatter2
.
dateFormat
=
"dd/MM/yyyy"
let
resultString
=
dateFormatter2
.
string
(
from
:
date
)
self
.
end_date
=
resultString
}
else
{
self
.
end_date
=
""
}
// let extra_fields = dictionary["extra_fields"] as? [String: Any]? ?? ["":""]
if
let
extra_fields
=
dictionary
[
"extra_fields"
]
as?
[
String
:
Any
]
{
self
.
subcategory
=
extra_fields
[
"subcategory"
]
as?
String
?
??
""
...
...
@@ -1400,6 +1430,24 @@ public class swiftApi {
self
.
unifiedCampaign
=
newValue
}
}
public
var
_start_date
:
String
?
{
get
{
// getter
return
self
.
start_date
}
set
(
newValue
)
{
//setter
self
.
start_date
=
newValue
}
}
public
var
_end_date
:
String
?
{
get
{
// getter
return
self
.
end_date
}
set
(
newValue
)
{
//setter
self
.
end_date
=
newValue
}
}
}
public
class
CampaignDataModel
{
...
...
Please
register
or
login
to post a comment