Debian Codegraph @

resources/lib/moment/locale/gu.js

raw symbols SCIP
1 //! moment.js locale configuration
2 //! locale : Gujarati [gu]
3 //! author : Kaushik Thanki : https://github.com/Kaushik1987
4
5 ;(function (global, factory) {
6 typeof exports === 'object' && typeof module !== 'undefined'
7 && typeof require === 'function' ? factory(require('../moment')) :
8 typeof define === 'function' && define.amd ? define(['../moment'], factory) :
9 factory(global.moment)
10 }(this, (function (moment) { 'use strict';
11
12 //! moment.js locale configuration
13
14 var symbolMap = {
15 '1': '૧',
16 '2': '૨',
17 '3': '૩',
18 '4': '૪',
19 '5': '૫',
20 '6': '૬',
21 '7': '૭',
22 '8': '૮',
23 '9': '૯',
24 '0': '૦',
25 },
26 numberMap = {
27 '૧': '1',
28 '૨': '2',
29 '૩': '3',
30 '૪': '4',
31 '૫': '5',
32 '૬': '6',
33 '૭': '7',
34 '૮': '8',
35 '૯': '9',
36 '૦': '0',
37 };
38
39 var gu = moment.defineLocale('gu', {
40 months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split(
41 '_'
42 ),
43 monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split(
44 '_'
45 ),
46 monthsParseExact: true,
47 weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split(
48 '_'
49 ),
50 weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
51 weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
52 longDateFormat: {
53 LT: 'A h:mm વાગ્યે',
54 LTS: 'A h:mm:ss વાગ્યે',
55 L: 'DD/MM/YYYY',
56 LL: 'D MMMM YYYY',
57 LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
58 LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે',
59 },
60 calendar: {
61 sameDay: '[આજ] LT',
62 nextDay: '[કાલે] LT',
63 nextWeek: 'dddd, LT',
64 lastDay: '[ગઇકાલે] LT',
65 lastWeek: '[પાછલા] dddd, LT',
66 sameElse: 'L',
67 },
68 relativeTime: {
69 future: '%s મા',
70 past: '%s પેહલા',
71 s: 'અમુક પળો',
72 ss: '%d સેકંડ',
73 m: 'એક મિનિટ',
74 mm: '%d મિનિટ',
75 h: 'એક કલાક',
76 hh: '%d કલાક',
77 d: 'એક દિવસ',
78 dd: '%d દિવસ',
79 M: 'એક મહિનો',
80 MM: '%d મહિનો',
81 y: 'એક વર્ષ',
82 yy: '%d વર્ષ',
83 },
84 preparse: function (string) {
85 return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {
86 return numberMap[match];
87 });
88 },
89 postformat: function (string) {
90 return string.replace(/\d/g, function (match) {
91 return symbolMap[match];
92 });
93 },
94 // Gujarati notation for meridiems are quite fuzzy in practice. While there exists
95 // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.
96 meridiemParse: /રાત|બપોર|સવાર|સાંજ/,
97 meridiemHour: function (hour, meridiem) {
98 if (hour === 12) {
99 hour = 0;
100 }
101 if (meridiem === 'રાત') {
102 return hour < 4 ? hour : hour + 12;
103 } else if (meridiem === 'સવાર') {
104 return hour;
105 } else if (meridiem === 'બપોર') {
106 return hour >= 10 ? hour : hour + 12;
107 } else if (meridiem === 'સાંજ') {
108 return hour + 12;
109 }
110 },
111 meridiem: function (hour, minute, isLower) {
112 if (hour < 4) {
113 return 'રાત';
114 } else if (hour < 10) {
115 return 'સવાર';
116 } else if (hour < 17) {
117 return 'બપોર';
118 } else if (hour < 20) {
119 return 'સાંજ';
120 } else {
121 return 'રાત';
122 }
123 },
124 week: {
125 dow: 0, // Sunday is the first day of the week.
126 doy: 6, // The week that contains Jan 6th is the first week of the year.
127 },
128 });
129
130 return gu;
131
132 })));