| 1 |
//! moment.js locale configuration |
| 2 |
//! locale : French [fr] |
| 3 |
//! author : John Fischer : https://github.com/jfroffice |
| 4 |
|
| 5 |
import moment from '../moment'; |
| 6 |
|
| 7 |
var monthsStrictRegex = |
| 8 |
/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, |
| 9 |
monthsShortStrictRegex = |
| 10 |
/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i, |
| 11 |
monthsRegex = |
| 12 |
/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, |
| 13 |
monthsParse = [ |
| 14 |
/^janv/i, |
| 15 |
/^févr/i, |
| 16 |
/^mars/i, |
| 17 |
/^avr/i, |
| 18 |
/^mai/i, |
| 19 |
/^juin/i, |
| 20 |
/^juil/i, |
| 21 |
/^août/i, |
| 22 |
/^sept/i, |
| 23 |
/^oct/i, |
| 24 |
/^nov/i, |
| 25 |
/^déc/i, |
| 26 |
]; |
| 27 |
|
| 28 |
export default moment.defineLocale('fr', { |
| 29 |
months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split( |
| 30 |
'_' |
| 31 |
), |
| 32 |
monthsShort: |
| 33 |
'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split( |
| 34 |
'_' |
| 35 |
), |
| 36 |
monthsRegex: monthsRegex, |
| 37 |
monthsShortRegex: monthsRegex, |
| 38 |
monthsStrictRegex: monthsStrictRegex, |
| 39 |
monthsShortStrictRegex: monthsShortStrictRegex, |
| 40 |
monthsParse: monthsParse, |
| 41 |
longMonthsParse: monthsParse, |
| 42 |
shortMonthsParse: monthsParse, |
| 43 |
weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), |
| 44 |
weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), |
| 45 |
weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), |
| 46 |
weekdaysParseExact: true, |
| 47 |
longDateFormat: { |
| 48 |
LT: 'HH:mm', |
| 49 |
LTS: 'HH:mm:ss', |
| 50 |
L: 'DD/MM/YYYY', |
| 51 |
LL: 'D MMMM YYYY', |
| 52 |
LLL: 'D MMMM YYYY HH:mm', |
| 53 |
LLLL: 'dddd D MMMM YYYY HH:mm', |
| 54 |
}, |
| 55 |
calendar: { |
| 56 |
sameDay: '[Aujourd’hui à] LT', |
| 57 |
nextDay: '[Demain à] LT', |
| 58 |
nextWeek: 'dddd [à] LT', |
| 59 |
lastDay: '[Hier à] LT', |
| 60 |
lastWeek: 'dddd [dernier à] LT', |
| 61 |
sameElse: 'L', |
| 62 |
}, |
| 63 |
relativeTime: { |
| 64 |
future: 'dans %s', |
| 65 |
past: 'il y a %s', |
| 66 |
s: 'quelques secondes', |
| 67 |
ss: '%d secondes', |
| 68 |
m: 'une minute', |
| 69 |
mm: '%d minutes', |
| 70 |
h: 'une heure', |
| 71 |
hh: '%d heures', |
| 72 |
d: 'un jour', |
| 73 |
dd: '%d jours', |
| 74 |
w: 'une semaine', |
| 75 |
ww: '%d semaines', |
| 76 |
M: 'un mois', |
| 77 |
MM: '%d mois', |
| 78 |
y: 'un an', |
| 79 |
yy: '%d ans', |
| 80 |
}, |
| 81 |
dayOfMonthOrdinalParse: /\d{1,2}(er|)/, |
| 82 |
ordinal: function (number, period) { |
| 83 |
switch (period) { |
| 84 |
// TODO: Return 'e' when day of month > 1. Move this case inside |
| 85 |
// block for masculine words below. |
| 86 |
// See https://github.com/moment/moment/issues/3375 |
| 87 |
case 'D': |
| 88 |
return number + (number === 1 ? 'er' : ''); |
| 89 |
|
| 90 |
// Words with masculine grammatical gender: mois, trimestre, jour |
| 91 |
default: |
| 92 |
case 'M': |
| 93 |
case 'Q': |
| 94 |
case 'DDD': |
| 95 |
case 'd': |
| 96 |
return number + (number === 1 ? 'er' : 'e'); |
| 97 |
|
| 98 |
// Words with feminine grammatical gender: semaine |
| 99 |
case 'w': |
| 100 |
case 'W': |
| 101 |
return number + (number === 1 ? 're' : 'e'); |
| 102 |
} |
| 103 |
}, |
| 104 |
week: { |
| 105 |
dow: 1, // Monday is the first day of the week. |
| 106 |
doy: 4, // The week that contains Jan 4th is the first week of the year. |
| 107 |
}, |
| 108 |
}); |