-
Notifications
You must be signed in to change notification settings - Fork 664
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
[DatePickRange]: 预设不支持 dayjs.utc #2113
Comments
vaynevayne
changed the title
[DatePickRange]: dayjs.utc 时间显示异常
[DatePickRange]: 预设不支持 dayjs.utc
Aug 1, 2023
修改建议, 支持字符串类型的shortcut(其实你们shortcut 部分的代码已经支持了), 但是并不会生效是因为这里卡住了, https://github.com/arco-design/arco-design/blob/main/components/DatePicker/picker-range.tsx#L656 getDayjsValue里面已经做了判断, isValidShortcut 是冗余的, 并且两者有冲突, 移除isValidShortcut判断即可https://github.com/arco-design/arco-design/blob/main/components/_util/dayjs.ts#L218 最后: // Callback when mouse entered the shortcuts
function onMouseEnterShortcut(shortcut) {
clearShortcutsTimer();
shortcutEnterTimer.current = setTimeout(() => {
// if (isValidShortcut(shortcut)) {
const nv = getDayjsValue(shortcut.value(), format, utcOffset, timezone) as Dayjs[];
setShortcutsValue(nv);
setFixedPageShowDates(nv);
// }
}, 50);
} |
15 tasks
小黑子 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
arco 是错误的: https://codesandbox.io/s/loving-feynman-s8zclz?file=/demo.js
antd 是正确的: https://codesandbox.io/s/yu-she-fan-wei-antd-5-7-3-forked-tvx4d3?file=/demo.tsx
正确的结束时间应该是: 2023-07-31
但是 组件显示的结束时间是 2023-08-01
ps: 未使用 utcoffset相关 prop
Basic Info
The text was updated successfully, but these errors were encountered: