mmntjs
Compatibility-first migration bridge away from moment.js

Docs

API Reference

Reserve a clear endpoint for exhaustive API documentation without forcing it into every guide page.

Guidance

Reference Map

The practical reference shape for mmntjs is smaller than a full generated API site, but it is still clear enough to navigate by concern. Start with the default mmntjs entry when you need moment-compatible behavior, use mmntjs/lite when size matters more than feature breadth, and treat plugins or locale modules as explicit add-ons rather than invisible side effects.

  • Factory and static APIs: moment(), moment.utc(), moment.duration(), moment.parseZone(), moment.min(), moment.max().
  • Instance APIs: parsing results, formatting, manipulation, comparison, locale, UTC/offset, and duration-related flows.
  • Add-on surfaces: mmntjs/lite, mmntjs/full, mmntjs/temporal, mmntjs/plugin/*, and mmntjs/locale/*.

Use Entry Points Deliberately

Entry-point choice is part of the API contract because it changes what code is available by default and what your bundle can shake away. That is why the reference should name those boundaries directly instead of assuming one universal import shape.

Teams migrating from moment.js often benefit from starting with the default entry for compatibility, then narrowing to lighter or more specialized entries only after the first rollout is stable.

  • Default entry: broadest compatibility-oriented surface.
  • Lite entry: smaller browser-oriented base with explicit add-backs.
  • Temporal entry: opt-in bridge, not part of the default runtime path.

Examples

Default compatibility entry

import moment from "mmntjs";

moment("2024-01-01").startOf("month").format("YYYY-MM-DD");
moment.parseZone("2024-01-01T09:00:00+09:00").utcOffset();

Start here when you need the broadest moment-compatible surface during migration.

Lite plus explicit add-ons

import moment from "mmntjs/lite";
import "mmntjs/plugin/format-parse";
import "mmntjs/locale/ja";

Use this when bundle size matters and you want each extra capability to be visible in imports.

Temporal bridge entry

import { fromTemporal, toTemporal } from "mmntjs/temporal";

const plainDateTime = toTemporal(fromTemporal(Temporal.Now.zonedDateTimeISO()));

Temporal helpers are opt-in and stay outside the default entry point.

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.