[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/resources/lib/moment/locale/ -> hy-am.js (source)

   1  // moment.js locale configuration
   2  // locale : Armenian (hy-am)
   3  // author : Armendarabyan : https://github.com/armendarabyan
   4  
   5  (function (factory) {
   6      if (typeof define === 'function' && define.amd) {
   7          define(['moment'], factory); // AMD
   8      } else if (typeof exports === 'object') {
   9          module.exports = factory(require('../moment')); // Node
  10      } else {
  11          factory(window.moment); // Browser global
  12      }
  13  }(function (moment) {
  14      function monthsCaseReplace(m, format) {
  15          var months = {
  16              'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'),
  17              'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_')
  18          },
  19  
  20          nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ?
  21              'accusative' :
  22              'nominative';
  23  
  24          return months[nounCase][m.month()];
  25      }
  26  
  27      function monthsShortCaseReplace(m, format) {
  28          var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_');
  29  
  30          return monthsShort[m.month()];
  31      }
  32  
  33      function weekdaysCaseReplace(m, format) {
  34          var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_');
  35  
  36          return weekdays[m.day()];
  37      }
  38  
  39      return moment.defineLocale('hy-am', {
  40          months : monthsCaseReplace,
  41          monthsShort : monthsShortCaseReplace,
  42          weekdays : weekdaysCaseReplace,
  43          weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  44          weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  45          longDateFormat : {
  46              LT : 'HH:mm',
  47              L : 'DD.MM.YYYY',
  48              LL : 'D MMMM YYYY թ.',
  49              LLL : 'D MMMM YYYY թ., LT',
  50              LLLL : 'dddd, D MMMM YYYY թ., LT'
  51          },
  52          calendar : {
  53              sameDay: '[այսօր] LT',
  54              nextDay: '[վաղը] LT',
  55              lastDay: '[երեկ] LT',
  56              nextWeek: function () {
  57                  return 'dddd [օրը ժամը] LT';
  58              },
  59              lastWeek: function () {
  60                  return '[անցած] dddd [օրը ժամը] LT';
  61              },
  62              sameElse: 'L'
  63          },
  64          relativeTime : {
  65              future : '%s հետո',
  66              past : '%s առաջ',
  67              s : 'մի քանի վայրկյան',
  68              m : 'րոպե',
  69              mm : '%d րոպե',
  70              h : 'ժամ',
  71              hh : '%d ժամ',
  72              d : 'օր',
  73              dd : '%d օր',
  74              M : 'ամիս',
  75              MM : '%d ամիս',
  76              y : 'տարի',
  77              yy : '%d տարի'
  78          },
  79  
  80          meridiem : function (hour) {
  81              if (hour < 4) {
  82                  return 'գիշերվա';
  83              } else if (hour < 12) {
  84                  return 'առավոտվա';
  85              } else if (hour < 17) {
  86                  return 'ցերեկվա';
  87              } else {
  88                  return 'երեկոյան';
  89              }
  90          },
  91  
  92          ordinal: function (number, period) {
  93              switch (period) {
  94              case 'DDD':
  95              case 'w':
  96              case 'W':
  97              case 'DDDo':
  98                  if (number === 1) {
  99                      return number + '-ին';
 100                  }
 101                  return number + '-րդ';
 102              default:
 103                  return number;
 104              }
 105          },
 106  
 107          week : {
 108              dow : 1, // Monday is the first day of the week.
 109              doy : 7  // The week that contains Jan 1st is the first week of the year.
 110          }
 111      });
 112  }));


Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1