Provides arbitrary date formatting control (using Luxon under the hood). For full details on the options for format control, see https://moment.github.io/luxon/#/formatting?id=table-of-tokens
In most cases you should prefer toLocaleString so your users see the format they expect. toLocaleString already has many formatting options.
A day of the month: 1-31 depending on the month
Hour of the day in 24 time: 0-23
Millisecond of the second: 0-999
Minute of the hour: 0-59
A month of the year: 1-12
The full, four digit year.
2023; Copy
2023;
import {toFormattedString} from 'date-vir';toFormattedString( { year: 2024, month: 9, day: 25, hour: 0, minute: 0, second: 0, millisecond: 0, }, 'MMM-yyyy',);// `'Sep-2024'` Copy
import {toFormattedString} from 'date-vir';toFormattedString( { year: 2024, month: 9, day: 25, hour: 0, minute: 0, second: 0, millisecond: 0, }, 'MMM-yyyy',);// `'Sep-2024'`
Provides arbitrary date formatting control (using Luxon under the hood). For full details on the options for format control, see https://moment.github.io/luxon/#/formatting?id=table-of-tokens
In most cases you should prefer toLocaleString so your users see the format they expect. toLocaleString already has many formatting options.