mmntjs
Compatibility-first migration bridge away from moment.js

Docs

Basic Usage

Formatting, parsing, manipulation, and duration examples without diving into API reference detail.

Guidance

Stay Close To Existing Moment Call Patterns At First

Basic usage examples should reassure evaluators that common moment-style creation, formatting, arithmetic, and duration flows still read naturally.

The first migration phase is usually about preserving behavior and minimizing review noise, not about rewriting every date call into a new style immediately.

  • Prefer examples that look like current moment code.
  • Use a mix of formatting, UTC, add/subtract, and duration examples.
  • Link out quickly when behavior becomes parsing- or timezone-sensitive.

Examples

Formatting and arithmetic

import moment from "mmntjs";

const invoiceDate = moment("2024-01-01");
const dueDate = invoiceDate.clone().add(30, "days");

dueDate.format("YYYY-MM-DD");

This is the kind of low-drama example teams want to see first during a migration review.

UTC flow

import moment from "mmntjs";

moment.utc("2024-06-15T12:30:00Z").format("YYYY-MM-DD HH:mm:ss");

Useful as a first check when the application already relies on explicit UTC handling.

Duration example

import moment from "mmntjs";

moment.duration(2, "hours").humanize();

Keep examples short and recognizable before diving into compatibility-sensitive details.

How To Use This Doc

Use this page as a migration review aid rather than as a generic tutorial. If the behavior in this area is business-critical, compare it directly against your current moment.js usage and record the outcome before expanding rollout.