Skip to Content

momentjs

The Moment.js rendering target. Imported from rosetta-date/libraries:

import { momentjs } from 'rosetta-date/libraries'
  • Base grammar: moment.
  • Extensions: none.
  • Support model: the reference implementation of the moment grammar — it renders every token, so it carries no supports set and converting to it never flags a grammar token.

Localized presets

momentjs spells the L… family. They map preset → preset with date-fns’s P… (see Localized presets).

MeaningToken
Date, short / medium / longL ll LL
Time, short / with secondsLT LTS
Date + time, medium / long / fulllll LLL LLLL

The moment grammar has no full-date, time-with-zone, or short date-time preset, so date-fns’s PPPP / ppp / pppp / Pp have no momentjs counterpart and literalize when converted to it.

Runtime: some tokens need a Moment.js companion at runtime even though momentjs renders them — e.g. time-zone-name tokens require moment-timezone. That is the consumer’s concern, not a conversion limit.

Last updated on