Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
0c96cdb8
Commit
0c96cdb8
authored
Sep 25, 2024
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑在港记录增加时间判断
parent
7bc0d6ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
7 deletions
+31
-7
YHHKRecordsEditContentVC.swift
...migrationRecords(在港记录管理)/C/YHHKRecordsEditContentVC.swift
+31
-7
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/HongKongImmigrationRecords(在港记录管理)/C/YHHKRecordsEditContentVC.swift
View file @
0c96cdb8
...
@@ -391,16 +391,29 @@ extension YHHKRecordsEditContentVC: UITableViewDelegate, UITableViewDataSource {
...
@@ -391,16 +391,29 @@ extension YHHKRecordsEditContentVC: UITableViewDelegate, UITableViewDataSource {
let
row
=
sectionArr
[
indexPath
.
row
]
let
row
=
sectionArr
[
indexPath
.
row
]
if
case
let
.
selectTime
(
title
,
detail
,
placeholder
,
timeType
)
=
row
{
if
case
let
.
selectTime
(
title
,
detail
,
placeholder
,
timeType
)
=
row
{
YHDatePickView
.
show
(
type
:
.
yyyymmdd
,
title
:
title
,
lastIsTaday
:
false
,
currentDay
:
detail
??
""
)
{
[
weak
self
]
dateStr
in
YHDatePickView
.
show
(
type
:
.
yyyymmdd
,
title
:
title
,
lastIsTaday
:
false
,
currentDay
:
detail
??
""
)
{
[
weak
self
]
dateStr
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
,
dateStr
.
count
>
0
else
{
return
}
var
sections
=
self
.
datas
[
indexPath
.
section
]
sections
[
indexPath
.
row
]
=
.
selectTime
(
title
,
dateStr
,
placeholder
,
timeType
)
self
.
datas
[
indexPath
.
section
]
=
sections
if
timeType
==
.
fromTime
{
if
timeType
==
.
fromTime
{
self
.
editModel
.
start_date
=
dateStr
if
self
.
editModel
.
end_date
.
count
>
0
,
self
.
compareDateStrings
(
dateStr
,
self
.
editModel
.
end_date
)
==
.
orderedDescending
{
YHHUD
.
flash
(
message
:
"入境时间不能晚于离境时间"
)
}
else
{
var
sections
=
self
.
datas
[
indexPath
.
section
]
sections
[
indexPath
.
row
]
=
.
selectTime
(
title
,
dateStr
,
placeholder
,
timeType
)
self
.
datas
[
indexPath
.
section
]
=
sections
self
.
editModel
.
start_date
=
dateStr
tableView
.
reloadRows
(
at
:
[
indexPath
],
with
:
.
automatic
)
}
}
else
{
}
else
{
self
.
editModel
.
end_date
=
dateStr
if
self
.
editModel
.
start_date
.
count
>
0
,
self
.
compareDateStrings
(
self
.
editModel
.
start_date
,
dateStr
)
==
.
orderedDescending
{
YHHUD
.
flash
(
message
:
"离境时间不能早于入境时间"
)
}
else
{
var
sections
=
self
.
datas
[
indexPath
.
section
]
sections
[
indexPath
.
row
]
=
.
selectTime
(
title
,
dateStr
,
placeholder
,
timeType
)
self
.
datas
[
indexPath
.
section
]
=
sections
self
.
editModel
.
end_date
=
dateStr
tableView
.
reloadRows
(
at
:
[
indexPath
],
with
:
.
automatic
)
}
}
}
tableView
.
reloadRows
(
at
:
[
indexPath
],
with
:
.
automatic
)
}
}
}
}
...
@@ -452,4 +465,15 @@ extension YHHKRecordsEditContentVC {
...
@@ -452,4 +465,15 @@ extension YHHKRecordsEditContentVC {
attStr
.
setAttributes
([
.
foregroundColor
:
UIColor
.
brandMainColor
],
range
:
NSRange
(
location
:
normalTextFirst
.
count
,
length
:
attText
.
count
))
attStr
.
setAttributes
([
.
foregroundColor
:
UIColor
.
brandMainColor
],
range
:
NSRange
(
location
:
normalTextFirst
.
count
,
length
:
attText
.
count
))
return
attStr
return
attStr
}
}
private
func
compareDateStrings
(
_
date1
:
String
,
_
date2
:
String
)
->
ComparisonResult
?
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd"
// 根据你的日期字符串格式调整
guard
let
firstDate
=
dateFormatter
.
date
(
from
:
date1
),
let
secondDate
=
dateFormatter
.
date
(
from
:
date2
)
else
{
YHHUD
.
flash
(
message
:
"日期字符串格式无效"
)
return
nil
}
return
firstDate
.
compare
(
secondDate
)
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment