PageSourceSearch

https://gornica-len.ru/catalog/view/javascript/jquery/datetimepicker/locale/ru.js

js gornica-len.ru collected 2026-10-04 23:05:25 UTC 6,613 bytes, 163 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 (global, factory) {
7   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :
8   typeof define === 'function' && define.amd ? define(['moment'], factory) :
9   factory(global.moment)
10}(this, function (moment) { 'use strict';
11
12
13    function plural(word, num) {
14        var forms = word.split('_');
15        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]);
16    }
17    function relativeTimeWithPlural(number, withoutSuffix, key) {
18        var format = {
19            'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
20            'hh': 'час_часа_часов',
21            'dd': 'день_дня_дней',
22            'MM': 'месяц_месяца_месяцев',
23            'yy': 'год_года_лет'
24        };
25        if (key === 'm') {
26            return withoutSuffix ? 'минута' : 'минуту';
27        }
28        else {
29            return number + ' ' + plural(format[key], +number);
30        }
31    }
32    function monthsCaseReplace(m, format) {
33        var months = {
34            'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
35            'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')
36        },
37        nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ?
38            'accusative' :
39            'nominative';
40        return months[nounCase][m.month()];
41    }
42    function monthsShortCaseReplace(m, format) {
43        var monthsShort = {
44            'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
45            'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_')
46        },
47        nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ?
48            'accusative' :
49            'nominative';
50        return monthsShort[nounCase][m.month()];
51    }
52    function weekdaysCaseReplace(m, format) {
53        var weekdays = {
54            'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
55            'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_')
56        },
57        nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/).test(format) ?
58            'accusative' :
59            'nominative';
60        return weekdays[nounCase][m.day()];
61    }
62
63    var ru = moment.defineLocale('ru', {
64        months : monthsCaseReplace,
65        monthsShort : monthsShortCaseReplace,
66        weekdays : weekdaysCaseReplace,
67        weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
68        weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
69        monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i],
70        longDateFormat : {
71            LT : 'HH:mm',
72            LTS : 'HH:mm:ss',
73            L : 'DD.MM.YYYY',
74            LL : 'D MMMM YYYY г.',
75            LLL : 'D MMMM YYYY г., HH:mm',
76            LLLL : 'dddd, D MMMM YYYY г., HH:mm'
77        },
78        calendar : {
79            sameDay: '[Сегодня в] LT',
80            nextDay: '[Завтра в] LT',
81            lastDay: '[Вчера в] LT',
82            nextWeek: function () {
83                return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
84            },
85            lastWeek: function (now) {
86                if (now.week() !== this.week()) {
87                    switch (this.day()) {
88                    case 0:
89                        return '[В прошлое] dddd [в] LT';
90                    case 1:
91                    case 2:
92                    case 4:
93                        return '[В прошлый] dddd [в] LT';
94                    case 3:
95                    case 5:
96                    case 6:
97                        return '[В прошлую] dddd [в] LT';
98                    }
99                } else {
100                    if (this.day() === 2) {
101                        return '[Во] dddd [в] LT';
102                    } else {
103                        return '[В] dddd [в] LT';
104                    }
105                }
106            },
107            sameElse: 'L'
108        },
109        relativeTime : {
110            future : 'через %s',
111            past : '%s назад',
112            s : 'несколько секунд',
113            m : relativeTimeWithPlural,
114            mm : relativeTimeWithPlural,
115            h : 'час',
116            hh : relativeTimeWithPlural,
117            d : 'день',
118            dd : relativeTimeWithPlural,
119            M : 'месяц',
120            MM : relativeTimeWithPlural,
121            y : 'год',
122            yy : relativeTimeWithPlural
123        },
124        meridiemParse: /ночи|утра|дня|вечера/i,
125        isPM : function (input) {
126            return /^(дня|вечера)$/.test(input);
127        },
128        meridiem : function (hour, minute, isLower) {
129            if (hour < 4) {
130                return 'ночи';
131            } else if (hour < 12) {
132                return 'утра';
133            } else if (hour < 17) {
134                return 'дня';
135            } else {
136                return 'вечера';
137            }
138        },
139        ordinalParse: /\d{1,2}-(й|го|я)/,
140        ordinal: function (number, period) {
141            switch (period) {
142            case 'M':
143            case 'd':
144            case 'DDD':
145                return number + '-й';
146            case 'D':
147                return number + '-го';
148            case 'w':
149            case 'W':
150                return number + '-я';
151            default:
152                return number;
153            }
154        },
155        week : {
156            dow : 1, // Monday is the first day of the week.
157            doy : 7  // The week that contains Jan 1st is the first week of the year.
158        }
159    });
160
161    return ru;
162
163}));

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.