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

时间插件增加上下午选项 #2627

Closed
wants to merge 4 commits into from
Closed

时间插件增加上下午选项 #2627

wants to merge 4 commits into from

Conversation

jack87918
Copy link

@jack87918 jack87918 commented Apr 12, 2018

Please makes sure the items are checked before submitting your PR, thank you!

  • Rebase before creating a PR to keep commit history clear.
  • Only One commit
  • No eslint errors

@airyland
Copy link
Owner

please add an example in Datetime demo.

@jack87918
Copy link
Author

调用:
format: "YYYY-MM-DD A"
A表示可以选择上午及下午
效果如下:
image

@airyland
Copy link
Owner

上面的例子的问题在于小时从 0 到 23,和右边上午下午存在逻辑冲突,因为不存在 13 点上午这个表达。

@jack87918
Copy link
Author

jack87918 commented Apr 12, 2018

Hi @airyland , 理论上来说:
上午: 0:00至11:59; 下午: 12:00至23:59 。
你提到的情况,假如developer的hour采用的是24小时制,又使用了上下午的格式,肯定是会有冲突的,所以需要使用12小时制。

我写到的demo, 是以“年月日 上/下午”为例。

@jack87918
Copy link
Author

望楼主审核通过pr, 希望让更多小伙伴收益

@airyland
Copy link
Owner

麻烦 example 补充到 Datetime.vue 里并且在 metas.yml 添加文档。

@jack87918
Copy link
Author

hi @airyland 已经提交demo及说明文档,烦请merge

@airyland
Copy link
Owner

似乎没有通过 eslint,运行时,缩进空格分号什么的都应该会报错。

@jack87918
Copy link
Author

@airyland hi, 楼主,多谢指正,已经通过eslint, 烦请merge。

@airyland
Copy link
Owner

这样的格式得到的数据是类似于 2018-04-13 上午 这样的数据,没有这种场景需求,不知道是不是值使用 AM PM 更合适。

@jack87918
Copy link
Author

实际我们应用这个时间组件的时候,就有选上午下午的需求场景(请假、换班等很多是以半天为单位) 。楼主的建议是把值调整为AM/PM ?

@airyland
Copy link
Owner

对,场景没问题,是这个值,用 AM PM 会不会更合适?

@jack87918
Copy link
Author

@airyland 已经更新pr。

@airyland
Copy link
Owner

选择值后再打开无法选中原来选择的 AM 或者 PM,这个我来处理。

@airyland
Copy link
Owner

已经合并,本地作了修改为了 commit 干净仅保留一条记录。

@airyland airyland closed this Apr 13, 2018
@jack87918
Copy link
Author

@airyland 楼主,烦请publish到npm,谢谢。

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

Successfully merging this pull request may close these issues.

None yet

2 participants