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 [Date-Picker] week display #6073

Merged
merged 1 commit into from
Jul 8, 2024
Merged

fix [Date-Picker] week display #6073

merged 1 commit into from
Jul 8, 2024

Conversation

sigma-plus
Copy link
Contributor

@sigma-plus sigma-plus commented Jun 22, 2024

fix #6069

Copy link

vercel bot commented Jun 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
naive-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2024 8:54am

@sigma-plus
Copy link
Contributor Author

针对 #6069 的解释:

在 date-fns 中,'RRRR' 和 'yyyy' 这两个模板字符串用于格式化年份,它们之间有一些区别:

'yyyy':表示四位数字的年份,例如2022、2023等。这代表日历年,即一般意义上的年份,和公历年份一致。

'RRRR':表示在 ISO 周历中的年份。ISO 周历是一种以周为基本单位的日历系统,'RRRR' 对应的年份是根据 ISO 周历系统中的周开始时间来决定的。
所以,week 显示时,应该选用 RRRR

@sigma-plus
Copy link
Contributor Author

sigma-plus commented Jun 22, 2024

ISO 关于年度week的标准 https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system

根据 ISO 标准,确定一年的第一周(W01)的方法如下:

如果1月1日是周一、周二、周三或周四,则1月1日所在的周被认为是该年的第一周。除非1月1日是周一,否则这个周包括上一年的最后一天或最后几天。

如果1月1日是周五、周六或周日,则1月1日被视为上一年的最后一周的一部分。第1周将从1月1日后的第一个周一开始

@07akioni
Copy link
Collaborator

07akioni commented Jul 8, 2024

学到了

@07akioni 07akioni merged commit 09af7ea into tusen-ai:main Jul 8, 2024
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

日期选择器 Date Picker 周次错误
3 participants