-
-
Notifications
You must be signed in to change notification settings - Fork 513
Replace Moment.js with Day.js #1236
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
base: master
Are you sure you want to change the base?
Conversation
* Switch from moment to dayjs for date/time handling * Update type definitions from Moment to Dayjs * Update locale configuration * Remove moment.js dependency
* Update SQL date import to use dayjs * Update vanilla date/time components to use dayjs * Clean up imports
* Migrate from moment to dayjs in date/time pickers * Update Button.Group to Space.Compact * Restructure widget folders for better organization * Clean up imports and types
* Update Bootstrap DateTime component * Update Fluent UI date/time components * Convert moment method calls to dayjs equivalents
…k#865) * Switch from @date-io/moment to @date-io/dayjs adapter * Update MUI providers to use AdapterDayjs * Update Material and MUI date/time pickers * Update package dependencies
* Replace moment dependencies with dayjs * Update webpack configuration for dayjs locales * Update locale settings in demo configs * Remove moment-locales-webpack-plugin
to correctly handle immutability of date objects (Replace deprecated Moment.js (potentially with Day.js) ukrbublik#865
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 52be970:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request replaces all references to Moment.js with Day.js, ensuring a lighter-weight dependency while maintaining date and time functionalities.
- Updated all utility modules and widget components to use Day.js
- Adjusted configuration and documentation to reflect the new Day.js usage
- Removed deprecated Moment.js-specific modules from the Ant Design widgets
Reviewed Changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/core/modules/utils/index.js | Replaced moment export with dayjs |
packages/core/modules/utils/configExtend.js | Updated imports and usage to reflect Day.js |
packages/core/modules/import/jsonLogic.js | Updated date formatting functions to use Day.js |
packages/core/modules/config/index.js | Modified widget functions to utilize Day.js for formatting |
packages/core/modules/config/default.js | Changed locale settings from moment to dayjs |
packages/core/modules/config/ctx.js | Replaced moment with dayjs in configuration |
packages/bootstrap/modules/widgets/value/BootstrapDateTime.jsx | Updated date/time formatting and usage from moment to dayjs |
packages/antd/modules/widgets/value/Time.jsx | Replaced moment usage with dayjs in time widget handling |
packages/antd/modules/widgets/value/DateTime.jsx | Updated date/time handling to use dayjs |
packages/antd/modules/widgets/value/Date.jsx | Replaced moment-based value conversion functions with dayjs |
packages/antd/modules/widgets/moment/* | Removed Moment.js-specific widget files |
packages/antd/modules/widgets/dayjs/* | Introduced new widget files to support Day.js usage |
CONFIG.adoc | Updated configuration documentation from moment to dayjs |
Comments suppressed due to low confidence (3)
packages/antd/modules/widgets/moment/index.tsx:1
- [nitpick] Confirm that removing Moment.js-specific widget exports does not break backward compatibility for any dependent modules.
export { default as DatePicker } from "./DatePicker";
CONFIG.adoc:306
- [nitpick] Verify that the documentation references and links are updated to correctly point to Day.js resources instead of Moment.js.
locale.dayjs: 'ru',
packages/core/modules/config/index.js:878
- Ensure that Day.js is configured with the necessary plugins (e.g., for ISO 8601 parsing and locale support) as its default behavior can differ from Moment.js.
const dateVal = this.utils.dayjs(val, wgtDef.valueFormat);
Fixes #865