de-ch.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //! moment.js locale configuration
  2. //! locale : German (Switzerland) [de-ch]
  3. //! author : sschueller : https://github.com/sschueller
  4. // based on: https://www.bk.admin.ch/dokumentation/sprachen/04915/05016/index.html?lang=de#
  5. import moment from '../moment';
  6. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  7. var format = {
  8. m: ['eine Minute', 'einer Minute'],
  9. h: ['eine Stunde', 'einer Stunde'],
  10. d: ['ein Tag', 'einem Tag'],
  11. dd: [number + ' Tage', number + ' Tagen'],
  12. w: ['eine Woche', 'einer Woche'],
  13. M: ['ein Monat', 'einem Monat'],
  14. MM: [number + ' Monate', number + ' Monaten'],
  15. y: ['ein Jahr', 'einem Jahr'],
  16. yy: [number + ' Jahre', number + ' Jahren'],
  17. };
  18. return withoutSuffix ? format[key][0] : format[key][1];
  19. }
  20. export default moment.defineLocale('de-ch', {
  21. months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  22. '_'
  23. ),
  24. monthsShort:
  25. 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
  26. monthsParseExact: true,
  27. weekdays:
  28. 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
  29. '_'
  30. ),
  31. weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  32. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  33. weekdaysParseExact: true,
  34. longDateFormat: {
  35. LT: 'HH:mm',
  36. LTS: 'HH:mm:ss',
  37. L: 'DD.MM.YYYY',
  38. LL: 'D. MMMM YYYY',
  39. LLL: 'D. MMMM YYYY HH:mm',
  40. LLLL: 'dddd, D. MMMM YYYY HH:mm',
  41. },
  42. calendar: {
  43. sameDay: '[heute um] LT [Uhr]',
  44. sameElse: 'L',
  45. nextDay: '[morgen um] LT [Uhr]',
  46. nextWeek: 'dddd [um] LT [Uhr]',
  47. lastDay: '[gestern um] LT [Uhr]',
  48. lastWeek: '[letzten] dddd [um] LT [Uhr]',
  49. },
  50. relativeTime: {
  51. future: 'in %s',
  52. past: 'vor %s',
  53. s: 'ein paar Sekunden',
  54. ss: '%d Sekunden',
  55. m: processRelativeTime,
  56. mm: '%d Minuten',
  57. h: processRelativeTime,
  58. hh: '%d Stunden',
  59. d: processRelativeTime,
  60. dd: processRelativeTime,
  61. w: processRelativeTime,
  62. ww: '%d Wochen',
  63. M: processRelativeTime,
  64. MM: processRelativeTime,
  65. y: processRelativeTime,
  66. yy: processRelativeTime,
  67. },
  68. dayOfMonthOrdinalParse: /\d{1,2}\./,
  69. ordinal: '%d.',
  70. week: {
  71. dow: 1, // Monday is the first day of the week.
  72. doy: 4, // The week that contains Jan 4th is the first week of the year.
  73. },
  74. });