de-ch.js 2.7 KB

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