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: disabledHours & feat: now work with step #88

Merged
merged 29 commits into from Jun 23, 2020
Merged

fix: disabledHours & feat: now work with step #88

merged 29 commits into from Jun 23, 2020

Conversation

07akioni
Copy link
Contributor

@07akioni 07akioni commented Jun 18, 2020

fix: disabledHours works unexpectly when using 12 hours
fix ant-design/ant-design#21159

  1. Hour should start from 12 at both AM and PM.
  2. Hour should be disabled by 0 ~ 23, not 0 ~ 11.
  3. AM & PM should be disabled at proper time.

feat: now button should work with time step
resolve ant-design/ant-design#25054

@codecov
Copy link

codecov bot commented Jun 18, 2020

Codecov Report

Merging #88 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #88      +/-   ##
==========================================
+ Coverage   99.55%   99.56%   +0.01%     
==========================================
  Files          42       43       +1     
  Lines        1792     1839      +47     
  Branches      538      551      +13     
==========================================
+ Hits         1784     1831      +47     
  Misses          6        6              
  Partials        2        2              
Impacted Files Coverage Δ
src/panels/TimePanel/TimeUnitColumn.tsx 100.00% <ø> (ø)
src/PickerPanel.tsx 100.00% <100.00%> (ø)
src/panels/TimePanel/TimeBody.tsx 100.00% <100.00%> (ø)
src/utils/timeUtil.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b921c3...9962d03. Read the comment docs.

@afc163
Copy link
Member

afc163 commented Jun 18, 2020

顺便把 ant-design/ant-design#25054 也修了吧

@07akioni 07akioni changed the title fix: disabledHours works unexpectly when using 12 hours fix & feat Jun 18, 2020
src/PickerPanel.tsx Outdated Show resolved Hide resolved
@afc163
Copy link
Member

afc163 commented Jun 19, 2020

标题要有语义。

@07akioni 07akioni changed the title fix & feat fix: disabledHours & feat: now work with step Jun 19, 2020
src/PickerPanel.tsx Outdated Show resolved Hide resolved
src/PickerPanel.tsx Outdated Show resolved Hide resolved
src/generate/moment.ts Outdated Show resolved Hide resolved
@zombieJ
Copy link
Member

zombieJ commented Jun 19, 2020

@07akioni @afc163 我比较坚持截断时间而不是就近取 Now。像跨天的场景:
steps: [1, 30, 1] 在 23:46:00 的时候点击了 Now 变成了第二天的 00:00:00 是很怪异的情况。
时间也应该和天一样做截断才对。

@afc163
Copy link
Member

afc163 commented Jun 19, 2020

01:44 和 01:46 同属 01:30 时间段,四舍五入确实会比较奇怪。

@vercel
Copy link

vercel bot commented Jun 22, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/picker/fsjnhce4a
✅ Preview: https://picker-git-fix-12-hours.react-component.vercel.app

@vercel vercel bot temporarily deployed to Preview June 22, 2020 02:40 Inactive
@zombieJ
Copy link
Member

zombieJ commented Jun 23, 2020

+ rc-picker@1.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants