is.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. //! moment.js locale configuration
  2. //! locale : Icelandic [is]
  3. //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
  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. //! moment.js locale configuration
  11. function plural(n) {
  12. if (n % 100 === 11) {
  13. return true;
  14. } else if (n % 10 === 1) {
  15. return false;
  16. }
  17. return true;
  18. }
  19. function translate(number, withoutSuffix, key, isFuture) {
  20. var result = number + ' ';
  21. switch (key) {
  22. case 's':
  23. return withoutSuffix || isFuture
  24. ? 'nokkrar sekúndur'
  25. : 'nokkrum sekúndum';
  26. case 'ss':
  27. if (plural(number)) {
  28. return (
  29. result +
  30. (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum')
  31. );
  32. }
  33. return result + 'sekúnda';
  34. case 'm':
  35. return withoutSuffix ? 'mínúta' : 'mínútu';
  36. case 'mm':
  37. if (plural(number)) {
  38. return (
  39. result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum')
  40. );
  41. } else if (withoutSuffix) {
  42. return result + 'mínúta';
  43. }
  44. return result + 'mínútu';
  45. case 'hh':
  46. if (plural(number)) {
  47. return (
  48. result +
  49. (withoutSuffix || isFuture
  50. ? 'klukkustundir'
  51. : 'klukkustundum')
  52. );
  53. }
  54. return result + 'klukkustund';
  55. case 'd':
  56. if (withoutSuffix) {
  57. return 'dagur';
  58. }
  59. return isFuture ? 'dag' : 'degi';
  60. case 'dd':
  61. if (plural(number)) {
  62. if (withoutSuffix) {
  63. return result + 'dagar';
  64. }
  65. return result + (isFuture ? 'daga' : 'dögum');
  66. } else if (withoutSuffix) {
  67. return result + 'dagur';
  68. }
  69. return result + (isFuture ? 'dag' : 'degi');
  70. case 'M':
  71. if (withoutSuffix) {
  72. return 'mánuður';
  73. }
  74. return isFuture ? 'mánuð' : 'mánuði';
  75. case 'MM':
  76. if (plural(number)) {
  77. if (withoutSuffix) {
  78. return result + 'mánuðir';
  79. }
  80. return result + (isFuture ? 'mánuði' : 'mánuðum');
  81. } else if (withoutSuffix) {
  82. return result + 'mánuður';
  83. }
  84. return result + (isFuture ? 'mánuð' : 'mánuði');
  85. case 'y':
  86. return withoutSuffix || isFuture ? 'ár' : 'ári';
  87. case 'yy':
  88. if (plural(number)) {
  89. return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
  90. }
  91. return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
  92. }
  93. }
  94. var is = moment.defineLocale('is', {
  95. months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split(
  96. '_'
  97. ),
  98. monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
  99. weekdays: 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split(
  100. '_'
  101. ),
  102. weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
  103. weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
  104. longDateFormat: {
  105. LT: 'H:mm',
  106. LTS: 'H:mm:ss',
  107. L: 'DD.MM.YYYY',
  108. LL: 'D. MMMM YYYY',
  109. LLL: 'D. MMMM YYYY [kl.] H:mm',
  110. LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm',
  111. },
  112. calendar: {
  113. sameDay: '[í dag kl.] LT',
  114. nextDay: '[á morgun kl.] LT',
  115. nextWeek: 'dddd [kl.] LT',
  116. lastDay: '[í gær kl.] LT',
  117. lastWeek: '[síðasta] dddd [kl.] LT',
  118. sameElse: 'L',
  119. },
  120. relativeTime: {
  121. future: 'eftir %s',
  122. past: 'fyrir %s síðan',
  123. s: translate,
  124. ss: translate,
  125. m: translate,
  126. mm: translate,
  127. h: 'klukkustund',
  128. hh: translate,
  129. d: translate,
  130. dd: translate,
  131. M: translate,
  132. MM: translate,
  133. y: translate,
  134. yy: translate,
  135. },
  136. dayOfMonthOrdinalParse: /\d{1,2}\./,
  137. ordinal: '%d.',
  138. week: {
  139. dow: 1, // Monday is the first day of the week.
  140. doy: 4, // The week that contains Jan 4th is the first week of the year.
  141. },
  142. });
  143. return is;
  144. })));