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

YearPicker: 关于只选择年的日期选择器属性 #4524

Open
songdun opened this issue Jan 9, 2017 · 22 comments

Comments

Projects
None yet
@songdun
Copy link

commented Jan 9, 2017

日期选择器能添加一个属性让它初始化就只选择年吗?目前只有日期和月

@afc163

This comment has been minimized.

Copy link
Member

commented Jan 9, 2017

单选的话,不如直接用 Select ?

@songdun

This comment has been minimized.

Copy link
Author

commented Jan 9, 2017

产品比较事儿 要用日期选择器的样子 5555555555555555

@afc163

This comment has been minimized.

Copy link
Member

commented Jan 9, 2017

单独维度的话,基于 DatePicker 改造成本较高且回报略低,用 Select 更简单和直接,我们在 https://ant.design/components/calendar/ 里也是这么做的。

你可以让你们的产品看这个回复。

@lock

This comment has been minimized.

Copy link

commented May 2, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 2, 2018

@afc163 afc163 reopened this Jun 26, 2018

@afc163

This comment has been minimized.

Copy link
Member

commented Jun 26, 2018

Maybe we should add a YearPicker now.

@jrschumacher

This comment has been minimized.

Copy link

commented Oct 12, 2018

@afc163 I have a WIP pull request for YearPicker react-component/calendar#427

@yoyo837

This comment has been minimized.

Copy link
Contributor

commented Oct 16, 2018

单纯下拉做不到 YearPicker 万年历 可选年份的需求。
Edit: 通常用在限制picker可选维度不同的地方,和DatePicker等一般是放在一起的,Picker的外观和交互更适合。

@jrschumacher Why not a picker ?

@jrschumacher

This comment has been minimized.

Copy link

commented Oct 16, 2018

@yoyo837 because you get the ability to view decades similar to the other calendars. But most importantly, to me, is a consistent UX. For all date-time data gathering the user will experience a similar interface.

@aixfox

This comment has been minimized.

Copy link

commented Nov 8, 2018

@afc163

Here are some reasons for YearPicker:

  1. Same styles as DatePicker.
  2. Select not exports moment instance.
  3. No disabledDate api of Select.

Hoping more consideration of year picker, thank you!

@Jetsly

This comment has been minimized.

Copy link

commented Nov 24, 2018

话说 不支持为啥 给出这个 mode={'year'} 的选项。。。

@jrschumacher

This comment has been minimized.

Copy link

commented Nov 24, 2018

@Jetsly yes they have to approve this PR first (react-component/calendar#427) then I can add the mode feature in ant-design

@lx70770

This comment has been minimized.

Copy link

commented Dec 13, 2018

@jrschumacher 您好 请问antd大概多久可以支持 mode='year' 这个属性呢

@jrschumacher

This comment has been minimized.

Copy link

commented Dec 15, 2018

@lx70770 I'm not sure Google translated that correctly. Antd/rc-calendar does not support this mode. I have not heard anything from my PR.

@lx70770

This comment has been minimized.

Copy link

commented Dec 15, 2018

@lx70770 I'm not sure Google translated that correctly. Antd/rc-calendar does not support this mode. I have not heard anything from my PR.
That's ok , Thank you so much!

@afc163 afc163 referenced this issue Dec 19, 2018

Closed

希望增加年份选择器 #13702

0 of 1 task complete

@afc163 afc163 referenced this issue Jan 10, 2019

Closed

希望DatePicker中实现YearPicker #14233

0 of 1 task complete
@yeluolei

This comment has been minimized.

Copy link

commented Jan 15, 2019

+1 for this feature

@jrschumacher

This comment has been minimized.

Copy link

commented Jan 15, 2019

@yeluolei will you add your reaction here: react-component/calendar#427

Sent with GitHawk

@afc163 afc163 changed the title 关于只选择年的日期选择器属性 YearPicker: 关于只选择年的日期选择器属性 Feb 27, 2019

@afc163 afc163 referenced this issue Mar 1, 2019

Closed

希望DatePicker提供一个接口yearPicker, #15133

0 of 1 task complete
@Aladingding

This comment has been minimized.

Copy link

commented Mar 29, 2019

{ getFieldDecorator(field)( <DatePicker placeholder={ placeholder || '请选择年份' } locale={ zhCN } // value={ this.state.time } open={ this.state.yearStartShow } mode='year' format='YYYY' // onChange={ this.handleChange } onOpenChange={ this.handleOpenChange } onPanelChange={ this.handlePanelChange } /> }

do like this ,you will fix this bug, combine use onOpenChange and onPanelChange (maybe you need onFocus onBlur)

tks, 一江西流 关于antd 日期组件只选择年份,设置mode=year无法获取value的解决办法

四个方法并用一定能完美实现你的需求,哈哈哈,官方说,你既然都单选了,为什么不用下拉框,说的好有道理,我竟无言以对
阿里产品真的考虑周全呀,>_< 但是我们产品说,我就要这样,我不管

@afc163

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

The list of date-related pickers we may need:

  • YearPicker 2019
  • MonthDatePicker 05-01
  • RangePicker.YearPicker 2019 ~ 2020
  • RangePicker.MonthPicker 2019-01 ~ 2020-10
  • RangePicker.MonthDatePicker 05-01 ~ 06-08
  • RangePicker.WeekPicker 2019-23rd ~ 2019-45rd
  • TimePicker.RangePicker 11:00 ~ 18:30

@afc163 afc163 referenced this issue Apr 11, 2019

Closed

Range/DatePicker设置mode后,onChange失效 #15572

0 of 1 task complete
@Geassu

This comment has been minimized.

Copy link

commented Apr 17, 2019

we need YearPicker right now

@DongShi

This comment has been minimized.

Copy link

commented Apr 28, 2019

Is the YearPicker available in the latest antd release?
How about adding a QuarterPicker?

@afc163 afc163 referenced this issue May 6, 2019

Closed

日期组件的年份选择器点击无反应 #16436

0 of 1 task complete
@zhangyanling77

This comment has been minimized.

Copy link

commented May 31, 2019

{ getFieldDecorator(field)( <DatePicker placeholder={ placeholder || '请选择年份' } locale={ zhCN } // value={ this.state.time } open={ this.state.yearStartShow } mode='year' format='YYYY' // onChange={ this.handleChange } onOpenChange={ this.handleOpenChange } onPanelChange={ this.handlePanelChange } /> }

do like this ,you will fix this bug, combine use onOpenChange and onPanelChange (maybe you need onFocus onBlur)

tks, 一江西流 关于antd 日期组件只选择年份,设置mode=year无法获取value的解决办法

四个方法并用一定能完美实现你的需求,哈哈哈,官方说,你既然都单选了,为什么不用下拉框,说的好有道理,我竟无言以对
阿里产品真的考虑周全呀,>_< 但是我们产品说,我就要这样,我不管

因为UI风格要统一,哈哈哈
我就是一江西流

@afc163

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.