Skip to content
New issue

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

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

Already on GitHub? # to your account

DatePicker 支持设置时区,或者通过config-provider配置整个app的时区 #2591

Open
Tracked by #6736 ...
ununian opened this issue Mar 9, 2022 · 5 comments
Open
Tracked by #6736 ...
Labels
feature request New feature or request priority: low

Comments

@ununian
Copy link
Contributor

ununian commented Mar 9, 2022

This function solves the problem (这个功能解决的问题)

我们有个需求是用户能手动设置显示的时区,而 new Date使用的是浏览器的时区

Expected API (期望的 API)

<n-config-provider time-zone='Asia/Shanghai' />
<n-date-picker time-zone='Asia/Shanghai' />
@github-actions github-actions bot added the feature request New feature or request label Mar 9, 2022
@07akioni
Copy link
Collaborator

07akioni commented Mar 9, 2022

这玩意其实一直在考虑,但是很难整,date-fns-tz 我用起来总有些问题,在不同的运行时结果不稳定。

@ununian
Copy link
Contributor Author

ununian commented Mar 22, 2022

这玩意其实一直在考虑,但是很难整,date-fns-tz 我用起来总有些问题,在不同的运行时结果不稳定。

什么叫运行时结果不稳定?是说在浏览器和 electron 之类的地方运行结果不一样?

@07akioni
Copy link
Collaborator

07akioni commented Mar 22, 2022

这玩意其实一直在考虑,但是很难整,date-fns-tz 我用起来总有些问题,在不同的运行时结果不稳定。

什么叫运行时结果不稳定?是说在浏览器和 electron 之类的地方运行结果不一样?

最简单的例子就是我在 n-time 里面搞的时区,在 github ci 上的结果不稳定,所以 test 暂时被我 ban 了。

具体原因我也说不清楚,还有就是我去对比过真实的时区时间和我通过 date-fns-tz 拿到的,感觉有点差别。

@ghost
Copy link

ghost commented Aug 25, 2023

+1 ,现在有方案吗

@firmianaQ
Copy link
Contributor

现在有方案吗

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature request New feature or request priority: low
Projects
None yet
Development

No branches or pull requests

3 participants