MOMENT 2.30.x · MAINTAINED FORK

@stackline/moment

A maintained Moment.js fork for parsing, validating, manipulating, formatting, and localizing dates with the classic API teams still depend on in production.

Legacy-compatible API Keep the upstream Moment.js surface for parsing, locale loading, durations, and relative time output.
Versioned docs history Every published package line gets its own docs source and compiled demo so behavior stays aligned with npm.
Interactive explorer Switch between parsing, formatting, UTC, locale, duration, and comparison scenarios without leaving the page.
Browser-ready assets Each docs line uses the actual minified assets from the published tarball for that package version.

Setup in 3 steps

1
Install
npm install @stackline/moment
2
Import the package
import moment from '@stackline/moment';
import '@stackline/moment/locale/fr';
3
Run the date workflow
moment.locale('fr');

const value = moment('2026-04-05 09:30', 'YYYY-MM-DD HH:mm', true);
value.clone().utc().format('YYYY-MM-DDTHH:mm:ss[Z]');

Example explorer

Browse the maintained Moment.js API by workflow instead of reading a flat README: parsing, strict validation, locale rendering, UTC offsets, durations, and range comparisons all stay visible in one place.



                

Interactive controls

API reference

These are the core package entry points and helpers that show up repeatedly across the versioned docs.

Core entry points

API Description
moment(input) Creates a local moment instance from strings, dates, arrays, objects, or timestamps.
moment.utc(input) Creates a UTC-based instance without relying on local timezone output.
moment.parseZone(input) Parses and preserves the original offset encoded in the input string.
moment.duration(value, unit) Creates a duration object for humanize, ISO serialization, and unit math.

Parsing and validation

API Description
moment(value, format) Parses custom formatted strings with a declared token pattern.
moment(value, format, true) Strict parsing rejects partial matches and malformed tokens.
isValid() Checks whether the current instance resolved to a valid date.
parsingFlags() Exposes unused tokens, overflow, and other parser diagnostics.

Formatting and locale

API Description
format(pattern) Formats the current instance with tokens such as YYYY, MM, and LLLL.
calendar() Returns locale-aware calendar phrases such as “Today at 9:00 AM”.
fromNow() Generates human relative time against the current moment.
moment.locale(locale) Switches the global locale used for long formats and relative time strings.

Published package artifacts

File Description
moment.js Classic CommonJS/browser entry kept for legacy integration paths.
dist/moment.js ES module-friendly build distributed with the package.
locale/ Individually loadable locale bundles for targeted installs.
min/ Browser-ready minified assets used by these versioned demos.
moment.d.ts Bundled TypeScript declarations for classic and TS 3.1+ consumers.