后续会跟进 react antd 的方案 https://ant.design/docs/react/replace-moment-cn 但不会移除 moment
装个antd-dayjs-webpack-plugin就好了
我是 Day.js 和 antd-dayjs-webpack-plugin 的作者,如果有需要,很乐意提供支持
moment.js 是维护状态了,https://momentjs.com/docs/#/-project-status/
https://github.com/ant-design/ant-design/issues/26759
ng-zorro-antd 现在使用 date-fns 了
即使有antd-dayjs-webpack-plugin,我还是想问一下,有没有改掉mutable写法的打算?比如lastMonth1.add(0 - lastMonthDiffDay, 'days')和current.add(passed, 'days')?
按照现在的写法,用antd-dayjs-webpack-plugin的时候必须用antdv3这个preset,它包含有badMutable这个插件,可以把dayjs变成mutable的,以完全兼容momentjs的mutable写法。但我觉得这样的话就没有达到使用dayjs的全部目的了——bundle size是减小了,却还是要用mutable的写法、要注意小心避免这种写法在不经意的时候修改了不想修改的dayjs实例。
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
Most helpful comment
我是 Day.js 和 antd-dayjs-webpack-plugin 的作者,如果有需要,很乐意提供支持