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
ac1c1b0e
Commit
ac1c1b0e
authored
Oct 19, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善了 最佳逻辑
parent
e166af99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
11 deletions
+28
-11
YHRangeDatePickerView2.swift
...t(在港递交预约)/V/RangeDatePicker2/YHRangeDatePickerView2.swift
+28
-11
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/RangeDatePicker2/YHRangeDatePickerView2.swift
View file @
ac1c1b0e
...
@@ -14,9 +14,18 @@ class YHRangeDatePickerView2: UIView,FSCalendarDataSource, FSCalendarDelegate, F
...
@@ -14,9 +14,18 @@ class YHRangeDatePickerView2: UIView,FSCalendarDataSource, FSCalendarDelegate, F
typealias
Block
=
(
Date
?)
->
()
typealias
Block
=
(
Date
?)
->
()
var
block
:
Block
?
var
block
:
Block
?
var
minDate
:
Date
?
var
minDate
:
Date
?
{
didSet
{
if
let
minDate
=
minDate
{
maxBestDate
=
self
.
gregorian
.
date
(
byAdding
:
.
day
,
value
:
6
,
to
:
minDate
)
}
}
}
var
maxDate
:
Date
?
var
maxDate
:
Date
?
//minDate + 7 - 1
var
maxBestDate
:
Date
?
static
let
viewH2
:
CGFloat
=
396
//508.0 - 52.0 -20 - 50
static
let
viewH2
:
CGFloat
=
396
//508.0 - 52.0 -20 - 50
...
@@ -113,17 +122,25 @@ extension YHRangeDatePickerView2 {
...
@@ -113,17 +122,25 @@ extension YHRangeDatePickerView2 {
func
calendar
(
_
calendar
:
FSCalendar
,
subtitleFor
date
:
Date
)
->
String
?
{
func
calendar
(
_
calendar
:
FSCalendar
,
subtitleFor
date
:
Date
)
->
String
?
{
if
let
start
=
startDate
{
if
let
maxBestDate
=
maxBestDate
{
if
self
.
gregorian
.
compare
(
start
,
to
:
date
,
toGranularity
:
.
day
)
.
rawValue
==
0
{
print
(
maxBestDate
)
return
"开始"
let
result
=
self
.
gregorian
.
compare
(
date
,
to
:
maxBestDate
,
toGranularity
:
.
day
)
}
}
if
let
end
=
endDate
{
if
self
.
gregorian
.
compare
(
end
,
to
:
date
,
toGranularity
:
.
day
)
.
rawValue
==
0
{
return
"结束"
}
if
result
==
.
orderedSame
{
return
"最佳"
}
else
if
result
==
.
orderedAscending
{
if
let
minDate
=
minDate
{
let
result2
=
self
.
gregorian
.
compare
(
date
,
to
:
minDate
,
toGranularity
:
.
day
)
if
result2
==
.
orderedDescending
{
return
"最佳"
}
else
if
result2
==
.
orderedSame
{
return
"最佳"
}
}
}
else
if
result
==
.
orderedDescending
{
return
nil
}
}
}
return
nil
return
nil
}
}
...
...
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