Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Calendar组件选择 “12小时”会无限循环的问题 #191

Merged
merged 3 commits into from
Jul 29, 2019

Conversation

zhou-yg
Copy link
Contributor

@zhou-yg zhou-yg commented Jul 11, 2019

endDate = [0, 0, 0] -> Datepicker.tsx#render -> [12, 0, 0] -> Picker.tsx -> didUpdate -> onValueChange -> value = [0, 0, 0] -> Datepicker endDate

无限循环链路

endDate = [0, 0, 0] -> Datepicker.tsx#render ->  [12, 0, 0] -> Picker.tsx -> didUpdate -> onValueChange -> value = [0, 0, 0] -> Datepicker endDate

无限循环链路
@@ -449,7 +449,7 @@ class DatePicker extends React.Component<IDatePickerProps, any> {
let dtValue = [hour + '', time.selMinute + ''];
let nhour = hour;
if (use12Hours) {
nhour = hour === 0 ? 12 : (hour > 12 ? hour - 12 : hour);
nhour = hour > 12 ? hour - 12 : hour;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

唯一的变化就是hour为零时的变化,原来是返回12,现在是直接返回0,这个对用户无感知么?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@doxiaodong doxiaodong changed the title fix:Calendar组件选择 “12小时”会无限循环的问题 fix: Calendar组件选择 “12小时”会无限循环的问题 Jul 29, 2019
@doxiaodong
Copy link
Contributor

+1

@doxiaodong doxiaodong merged commit b000dc8 into react-component:master Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants