1// moment.js locale configuration 2// locale : russian (ru) 3// author : Viktorminator : https://github.com/Viktorminator 4// Author : Menelion Elensúle : https://github.com/Oire 5 6(function (factory) { 7 if (typeof define === 'function' && define.amd) { 8 define(['moment'], factory); // AMD 9 } else if (typeof exports === 'object') { 10 module.exports = factory(require('../moment')); // Node 11 } else { 12 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global 13 } 14}(function (moment) { 15 function plural(word, num) { 16 var forms = word.split('_'); 17 return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); 18 } 19 20 function relativeTimeWithPlural(number, withoutSuffix, key) { 21 var format = { 22 'mm': withoutSuffix ? 'минÑÑа_минÑÑÑ_минÑÑ' : 'минÑÑÑ_минÑÑÑ_минÑÑ', 23 'hh': 'ÑаÑ_ÑаÑа_ÑаÑов', 24 'dd': 'денÑ_днÑ_дней', 25 'MM': 'меÑÑÑ_меÑÑÑа_меÑÑÑев', 26 'yy': 'год_года_леÑ' 27 }; 28 if (key === 'm') { 29 return withoutSuffix ? 'минÑÑа' : 'минÑÑÑ'; 30 } 31 else { 32 return number + ' ' + plural(format[key], +number); 33 } 34 } 35 36 function monthsCaseReplace(m, format) { 37 var months = { 38 'nominative': 'ÑнваÑÑ_ÑевÑалÑ_маÑÑ_апÑелÑ_май_иÑнÑ_иÑлÑ_авгÑÑÑ_ÑенÑÑбÑÑ_окÑÑбÑÑ_ноÑбÑÑ_декабÑÑ'.split('_'), 39 'accusative': 'ÑнваÑÑ_ÑевÑалÑ_маÑÑа_апÑелÑ_маÑ_иÑнÑ_иÑлÑ_авгÑÑÑа_ÑенÑÑбÑÑ_окÑÑбÑÑ_ноÑбÑÑ_декабÑÑ'.split('_') 40 }, 41 42 nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? 43 'accusative' : 44 'nominative'; 45 46 return months[nounCase][m.month()]; 47 } 48 49 function monthsShortCaseReplace(m, format) { 50 var monthsShort = { 51 'nominative': 'Ñнв_Ñев_маÑÑ_апÑ_май_иÑнÑ_иÑлÑ_авг_Ñен_окÑ_ноÑ_дек'.split('_'), 52 'accusative': 'Ñнв_Ñев_маÑ_апÑ_маÑ_иÑнÑ_иÑлÑ_авг_Ñен_окÑ_ноÑ_дек'.split('_') 53 }, 54 55 nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? 56 'accusative' : 57 'nominative'; 58 59 return monthsShort[nounCase][m.month()]; 60 } 61 62 function weekdaysCaseReplace(m, format) { 63 var weekdays = { 64 'nominative': 'воÑкÑеÑенÑе_понеделÑник_вÑоÑник_ÑÑеда_ÑеÑвеÑг_пÑÑниÑа_ÑÑббоÑа'.split('_'), 65 'accusative': 'воÑкÑеÑенÑе_понеделÑник_вÑоÑник_ÑÑедÑ_ÑеÑвеÑг_пÑÑниÑÑ_ÑÑббоÑÑ'.split('_') 66 }, 67 68 nounCase = (/\[ ?[Ðв] ?(?:пÑоÑлÑÑ|ÑледÑÑÑÑÑ|ÑÑÑ)? ?\] ?dddd/).test(format) ? 69 'accusative' : 70 'nominative'; 71 72 return weekdays[nounCase][m.day()]; 73 } 74 75 return moment.defineLocale('ru', { 76 months: monthsCaseReplace, 77 monthsShort: monthsShortCaseReplace, 78 weekdays: weekdaysCaseReplace, 79 weekdaysShort: 'вÑ_пн_вÑ_ÑÑ_ÑÑ_пÑ_Ñб'.split('_'), 80 weekdaysMin: 'вÑ_пн_вÑ_ÑÑ_ÑÑ_пÑ_Ñб'.split('_'), 81 monthsParse: [/^Ñнв/i, /^Ñев/i, /^маÑ/i, /^апÑ/i, /^ма[й|Ñ]/i, /^иÑн/i, /^иÑл/i, /^авг/i, /^Ñен/i, /^окÑ/i, /^ноÑ/i, /^дек/i], 82 longDateFormat: { 83 LT: 'HH:mm', 84 LTS: 'LT:ss', 85 L: 'DD.MM.YYYY', 86 LL: 'D MMMM YYYY г.', 87 LLL: 'D MMMM YYYY г., LT', 88 LLLL: 'dddd, D MMMM YYYY г., LT' 89 }, 90 calendar: { 91 sameDay: '[Ð¡ÐµÐ³Ð¾Ð´Ð½Ñ Ð²] LT', 92 nextDay: '[ÐавÑÑа в] LT', 93 lastDay: '[ÐÑеÑа в] LT', 94 nextWeek: function () { 95 return this.day() === 2 ? '[Ðо] dddd [в] LT' : '[Ð] dddd [в] LT'; 96 }, 97 lastWeek: function (now) { 98 if (now.week() !== this.week()) { 99 switch (this.day()) { 100 case 0: 101 return '[РпÑоÑлое] dddd [в] LT'; 102 case 1: 103 case 2: 104 case 4: 105 return '[РпÑоÑлÑй] dddd [в] LT'; 106 case 3: 107 case 5: 108 case 6: 109 return '[РпÑоÑлÑÑ] dddd [в] LT'; 110 } 111 } else { 112 if (this.day() === 2) { 113 return '[Ðо] dddd [в] LT'; 114 } else { 115 return '[Ð] dddd [в] LT'; 116 } 117 } 118 }, 119 sameElse: 'L' 120 }, 121 relativeTime: { 122 future: 'ÑеÑез %s', 123 past: '%s назад', 124 s: 'неÑколÑко ÑекÑнд', 125 m: relativeTimeWithPlural, 126 mm: relativeTimeWithPlural, 127 h: 'ÑаÑ', 128 hh: relativeTimeWithPlural, 129 d: 'денÑ', 130 dd: relativeTimeWithPlural, 131 M: 'меÑÑÑ', 132 MM: relativeTimeWithPlural, 133 y: 'год', 134 yy: relativeTimeWithPlural 135 }, 136 137 meridiemParse: /ноÑи|ÑÑÑа|днÑ|веÑеÑа/i, 138 isPM: function (input) { 139 return /^(днÑ|веÑеÑа)$/.test(input); 140 }, 141 142 meridiem: function (hour, minute, isLower) { 143 if (hour < 4) { 144 return 'ноÑи'; 145 } else if (hour < 12) { 146 return 'ÑÑÑа'; 147 } else if (hour < 17) { 148 return 'днÑ'; 149 } else { 150 return 'веÑеÑа'; 151 } 152 }, 153 154 ordinalParse: /\d{1,2}-(й|го|Ñ)/, 155 ordinal: function (number, period) { 156 switch (period) { 157 case 'M': 158 case 'd': 159 case 'DDD': 160 return number + '-й'; 161 case 'D': 162 return number + '-го'; 163 case 'w': 164 case 'W': 165 return number + '-Ñ'; 166 default: 167 return number; 168 } 169 }, 170 171 week: { 172 dow: 1, // Monday is the first day of the week. 173 doy: 7 // The week that contains Jan 1st is the first week of the year. 174 } 175 }); 176}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.