PageSourceSearch

https://xn--80akjfhmgn4l.market/vendors/moment/moment-locale_ru-RU.js

js xn--80akjfhmgn4l.market collected 2026-10-09 21:28:21 UTC 6,741 bytes, 176 lines download raw bytes

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.