Replace Moment.js with Day.js#1236
Open
Memoraike wants to merge 8 commits into
Open
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.
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);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #865