Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
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
杨凯
YDL-Component-Medical
Commits
5fb48d82
Commit
5fb48d82
authored
Jun 27, 2022
by
fengquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复设置生日页面的年份可以选择当前日期之后的时间
parent
4d0229af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
DatePickerDialogFragment.java
m-user/src/main/java/com/yidianling/user/mine/DatePickerDialogFragment.java
+15
-3
No files found.
m-user/src/main/java/com/yidianling/user/mine/DatePickerDialogFragment.java
View file @
5fb48d82
...
...
@@ -67,9 +67,21 @@ public class DatePickerDialogFragment extends BaseDialogFragment implements Date
@Override
public
void
onDateChanged
(
DatePicker
view
,
int
year
,
int
monthOfYear
,
int
dayOfMonth
)
{
this
.
year
=
year
;
this
.
month
=
monthOfYear
;
this
.
day
=
dayOfMonth
;
if
(
isDataAfter
(
view
))
{
Calendar
mCalendar
=
Calendar
.
getInstance
();
view
.
init
(
mCalendar
.
get
(
Calendar
.
YEAR
),
mCalendar
.
get
(
Calendar
.
MONTH
),
mCalendar
.
get
(
Calendar
.
DAY_OF_MONTH
),
this
);
}
}
private
boolean
isDataAfter
(
DatePicker
datePicker
)
{
Calendar
mCalendar
=
Calendar
.
getInstance
();
Calendar
tempCalendar
=
Calendar
.
getInstance
();
tempCalendar
.
set
(
datePicker
.
getYear
(),
datePicker
.
getMonth
(),
datePicker
.
getDayOfMonth
(),
0
,
0
,
0
);
if
(
tempCalendar
.
after
(
mCalendar
))
{
return
true
;
}
else
{
return
false
;
}
}
...
...
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