formatDate(value, options) {
    const usedOptions = options;
    const usedLocale = usedOptions?.locale || this.locale.name;
    let sourceDate = value;

    this.dateFormatter = new Intl.DateTimeFormat(
      usedLocale,
      usedOptions
    );

    // Validation
    if (/^0*$/.test(value)) {
      return '';
    }
    if (typeof value === 'string') {
      sourceDate = this.parseDate(sourceDate, options);
    }

    // Use 4 digit year
    // eslint-disable-next-line no-shadow
    let formattedDate = this.dateFormatter.formatToParts(sourceDate).map(({ type, value }) => {
      switch (type) {
      case 'year': return `${this.twoToFourDigitYear(value)}`;
      default: return value;
      }
    }).join('');

    if (!options || options?.dateStyle === 'short' || options?.year === 'numeric') {
      formattedDate = formattedDate.replace(', ', ' ');
    }
    return formattedDate;
  }
/**
   * Formats a date object using the current locale or specified settings
   * to a string for Internationalization
   * @param {Date} value The date to show in the current locale.
   * @param {object} options Additional date formatting settings.
   * @returns {string} the formatted date.
   */
Formats a date object using the current locale or specified settings
to a string for Internationalization
@param {Date} value The date to show in the current locale.
@param {object} options Additional date formatting settings.
@returns {string} the formatted date.
Formats a date object using the current locale or specified settings to a string for Internationalization @param { Date } value The date to show in the current locale . @param { object } options Additional date formatting settings . @returns { string } the formatted date .
formatDate(value, options) {
    const usedOptions = options;
    const usedLocale = usedOptions?.locale || this.locale.name;
    let sourceDate = value;
    this.dateFormatter = new Intl.DateTimeFormat(
      usedLocale,
      usedOptions
    );
    if (/^0*$/.test(value)) {
      return '';
    }
    if (typeof value === 'string') {
      sourceDate = this.parseDate(sourceDate, options);
    }
    let formattedDate = this.dateFormatter.formatToParts(sourceDate).map(({ type, value }) => {
      switch (type) {
      case 'year': return `${this.twoToFourDigitYear(value)}`;
      default: return value;
      }
    }).join('');
    if (!options || options?.dateStyle === 'short' || options?.year === 'numeric') {
      formattedDate = formattedDate.replace(', ', ' ');
    }
    return formattedDate;
  }
formatDate ( value , options ) { const usedOptions = options ; const usedLocale = usedOptions ?. locale || this . locale . name ; let sourceDate = value ; this . dateFormatter = new Intl . DateTimeFormat ( usedLocale , usedOptions ) ; if ( / ^0*$ / . test ( value ) ) { return '' ; } if ( typeof value === 'string' ) { sourceDate = this . parseDate ( sourceDate , options ) ; } let formattedDate = this . dateFormatter . formatToParts ( sourceDate ) . map ( ( { type , value } ) => { switch ( type ) { case 'year' : return ` ${ this . twoToFourDigitYear ( value ) } ` ; default : return value ; } } ) . join ( '' ) ; if ( ! options || options ?. dateStyle === 'short' || options ?. year === 'numeric' ) { formattedDate = formattedDate . replace ( ', ' , ' ' ) ; } return formattedDate ; }
Formats a date object using the current locale or specified settings
 to a string for Internationalization
 @param {Date} value The date to show in the current locale.
Formats a date object using the current locale or specified settings to a string for Internationalization @param { Date } value The date to show in the current locale .
// Validation // Use 4 digit year // eslint-disable-next-line no-shadow