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

RangePicker 时区问题 #837

Closed
luoluosa opened this issue Jan 11, 2016 · 10 comments
Closed

RangePicker 时区问题 #837

luoluosa opened this issue Jan 11, 2016 · 10 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@luoluosa
Copy link

RangePicker 不设置默认时间时弹窗显示的当前时间是不正确的,
比如当前是2016-01-11,默认时间显示的是 2016-01-10
配置中提供的 locale={locale} 不是很明白要怎么设置。

补充说明下,onChange 获取的 date 值 和显示的 date 值也是不一致的。

@afc163
Copy link
Member

afc163 commented Jan 11, 2016

http://ant.design/components/date-picker/#picker-demo-locale 看看时区是否可以解决,具体是 timezoneOffset 这个配置。8 * 60 代表东八区。

@luoluosa
Copy link
Author

@afc163 我看默认配置就是 timezoneOffset: 8*60 或者改为 timezoneOffset: 0。
在没有设置默认时间时,弹窗中的时间显示和 onChange 后的时间显示是不一致的。

@benjycui
Copy link
Contributor

的确有这个问题,RangePicker 上面显示的时间比 console.log 出来的慢了 16 个小时。。。

http://ant.design/components/date-picker/#picker-demo-range

image

@benjycui benjycui added the 🐛 Bug Ant Design Team had proved that this is a bug. label Jan 12, 2016
@luoluosa
Copy link
Author

这个 bug 大概什么时候 fix 呀?

@benjycui
Copy link
Contributor

下周吧,这周事多,急的话可以修改 timezoneOffset hack 一下。

(多啦A梦也不是万能的好么 。。。)

@yiminghe
Copy link
Contributor

应该全部 字符串或直接用 GregorianCalendar 传输

Date 有问题的

@afc163
Copy link
Member

afc163 commented Jan 15, 2016

DatePicker 里的 TimePicker 是没问题的。

@benjycui
Copy link
Contributor

See: react-component/calendar#98

@benjycui
Copy link
Contributor

And PR: react-component/calendar#99

afc163 added a commit that referenced this issue Jan 19, 2016
fix: locale should be passed to timePicker #837
@lock
Copy link

lock bot commented May 6, 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 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants