Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

French [FR] and French [FR-CA] using same config but they're slightly different #6594

Open
alihasan00 opened this issue Jul 10, 2023 · 0 comments
Assignees

Comments

@alihasan00
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Hi,
So, while using the ngx-bootstrap library, I just noticed that you're using the same config for the fr and fr-ca. But there is a minor difference in L formar(FR: DD/MM/YYY while FR-CA: YYYY-DD-MM) which is cauing problem in our app UI.
I've added the updated code. Please update it. thanks!

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
Please add following config!

import { LocaleData } from '../locale/locale.class';

//! moment.js locale configuration
//! locale : French Canadian [fr-CA]
//! author : John Fischer : https://github.com/jfroffice

export const frCALocale: LocaleData = {
  abbr: 'fr-CA',
  months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  monthsParseExact: true,
  weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  weekdaysParseExact: true,
  longDateFormat: {
    LT: 'HH:mm',
    LTS: 'HH:mm:ss',
    L: 'YYYY-MM-DD', // Canadian format is different: Year-Month-Day
    LL: 'D MMMM YYYY',
    LLL: 'D MMMM YYYY HH:mm',
    LLLL: 'dddd D MMMM YYYY HH:mm'
  },
  calendar: {
    sameDay: '[Aujourd’hui à] LT',
    nextDay: '[Demain à] LT',
    nextWeek: 'dddd [à] LT',
    lastDay: '[Hier à] LT',
    lastWeek: 'dddd [dernier à] LT',
    sameElse: 'L'
  },
  relativeTime: {
    future: 'dans %s',
    past: 'il y a %s',
    s: 'quelques secondes',
    ss: '%d secondes',
    m: 'une minute',
    mm: '%d minutes',
    h: 'une heure',
    hh: '%d heures',
    d: 'un jour',
    dd: '%d jours',
    M: 'un mois',
    MM: '%d mois',
    y: 'un an',
    yy: '%d ans'
  },
  dayOfMonthOrdinalParse: /\d{1,2}(er|e|)/,
  ordinal(_num: number, period: string): string {
    const num = Number(_num);
    switch (period) {
      case 'D':
        return num + (num === 1 ? 'er' : '');

      default:
      case 'M':
      case 'Q':
      case 'DDD':
      case 'd':
        return num + (num === 1 ? 'er' : 'e');

      case 'w':
      case 'W':
        return num + (num === 1 ? 're' : 'e');
    }
  },
  week: {
    dow: 1, // Monday is the first day of the week.
    doy: 4  // The week that contains Jan 4th is the first week of the year.
  }
};

A clear and concise description of what you want to happen.


**Describe alternatives you've considered**
No alternative

A clear and concise description of any alternative solutions or features you've considered.


**Additional context**

Add any other context or screenshots about the feature request here.
@lexasq lexasq self-assigned this Jul 15, 2024
@lexasq lexasq added the WIP label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants