-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
clone.weekday is not a function #123
Comments
Same here. |
…#123 & update @jnoodle/rc-picker
This is still an issue. Please lock dayjs version to 1.8.30 |
This workaround solves the issue without having to downgrade dayjs: ant-design/ant-design#26190 (comment) Those lines should be added into this library. |
I want to be able to use dayjs v1.9.x because they've fixed a slew of timezone-related issues from 1.8.3x, but it appears this library makes it impossible to use v1.9.x for now. |
@jstaro check my previous comment, you can use the latest dayjs by adding these lines. It worked for me with dayjs 1.9.3. |
@marian2js Yes I tried doing that, but it doesn't seem to work with the latest version of AntD (which relies on |
@jstaro found a way to do this.
|
@iMuFeng Thank you for the workaround. I will keep that in mind if we need it again! For now, we migrated our user code to use Luxon and only treat dayjs as a follow-along dependency of AntDesign, since we cannot fully control the version used. |
Any update? |
same error |
it's work |
dayjs => 1.11.9 在没有使用导入dayjs自带国际化配置时候是正常的 导入后就出现了 。 "It was working fine without importing the built-in internationalization configuration of dayjs, but after importing it, the issue occurred. Using the method mentioned above seems to work well. I'm just a novice programmer, but based on this code patch, it seems that the imported dayjs is overriding the original dayjs used in the DatePicker." |
thank you, it's work |
I wonder why this is still the issue 😳, there is lack of information inside the official docs 😞 I created adapter based only your solution, so it's more elegant to import inside components: // this is adapter for antd datepicker
// import it instead of the original dayjs
// more info here: https://github.com/react-component/picker/issues/123#issuecomment-728755491
import dj from 'dayjs'
import advancedFormat from 'dayjs/plugin/advancedFormat'
import customParseFormat from 'dayjs/plugin/customParseFormat'
import localeData from 'dayjs/plugin/localeData'
import weekday from 'dayjs/plugin/weekday'
import weekOfYear from 'dayjs/plugin/weekOfYear'
import weekYear from 'dayjs/plugin/weekYear'
dj.extend(customParseFormat)
dj.extend(advancedFormat)
dj.extend(weekday)
dj.extend(localeData)
dj.extend(weekOfYear)
dj.extend(weekYear)
export const dayjs = dj; |
dayjs <= 1.8.30 没有问题
dayjs > 1.8.30 点击日期选择器直接报错
The text was updated successfully, but these errors were encountered: