date-vir - v8.5.0
    Preparing search index...

    Function toFormattedString

    • 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.

      Parameters

      • fullDate: {
            day: DayOfMonth;
            hour: Hour;
            millisecond: number;
            minute: Minute;
            month: MonthNumber;
            second: Minute;
            timezone: string;
            year: number;
        }
        • day: DayOfMonth

          A day of the month: 1-31 depending on the month

        • hour: Hour

          Hour of the day in 24 time: 0-23

        • millisecond: number

          Millisecond of the second: 0-999

        • minute: Minute

          Minute of the hour: 0-59

        • month: MonthNumber

          A month of the year: 1-12

        • second: Minute
        • timezone: string
        • year: number

          The full, four digit year.

          2023;
          
      • format: string
      • localeOverride: string = userLocale

      Returns string

      import {toFormattedString} from 'date-vir';

      toFormattedString(
      {
      year: 2024,
      month: 9,
      day: 25,
      hour: 0,
      minute: 0,
      second: 0,
      millisecond: 0,
      },
      'MMM-yyyy',
      );
      // `'Sep-2024'`