packages/codemods/v5-0-0/17-rename-moment-to-dayjs.md
_moment to _dayjsComplexity: Simple
Rename all _moment operator keys to _dayjs across the Lowdefy app's YAML config files.
The _moment operator is replaced by _dayjs in Lowdefy v5. Every YAML key that starts with _moment followed by : or . must be renamed to _dayjs.
Patterns:
| Before | After |
|---|---|
_moment: | _dayjs: |
_moment.format: | _dayjs.format: |
_moment.humanizeDuration: | _dayjs.humanizeDuration: |
- _moment: | - _dayjs: |
- _moment.diff: | - _dayjs.diff: |
The rename applies to all _moment + method combinations. The method name itself does not change.
Find all .yaml and .yml files in the project (excluding node_modules/ and hidden directories).
In each file, search for _moment used as a YAML key — that is, _moment followed by either : (standalone operator) or . (operator with method). It may appear after whitespace, a list dash, or at the start of a line.
Replace each _moment with _dayjs, preserving the rest of the line exactly.
Report:
If no matches are found, report: "No _moment usage found. Nothing to rename."
_moment inside a quoted string value (e.g., description: "Uses _moment for dates") should not be changed.node_modules/, .git/, or other hidden directories.