1 package kok_IN
2
3 import (
4 "math"
5 "strconv"
6 "time"
7
8 "github.com/go-playground/locales"
9 "github.com/go-playground/locales/currency"
10 )
11
12 type kok_IN struct {
13 locale string
14 pluralsCardinal []locales.PluralRule
15 pluralsOrdinal []locales.PluralRule
16 pluralsRange []locales.PluralRule
17 decimal string
18 group string
19 minus string
20 percent string
21 perMille string
22 timeSeparator string
23 inifinity string
24 currencies []string
25 monthsAbbreviated []string
26 monthsNarrow []string
27 monthsWide []string
28 daysAbbreviated []string
29 daysNarrow []string
30 daysShort []string
31 daysWide []string
32 periodsAbbreviated []string
33 periodsNarrow []string
34 periodsShort []string
35 periodsWide []string
36 erasAbbreviated []string
37 erasNarrow []string
38 erasWide []string
39 timezones map[string]string
40 }
41
42
43 func New() locales.Translator {
44 return &kok_IN{
45 locale: "kok_IN",
46 pluralsCardinal: nil,
47 pluralsOrdinal: nil,
48 pluralsRange: nil,
49 decimal: ".",
50 group: ",",
51 minus: "-",
52 percent: "%",
53 perMille: "‰",
54 timeSeparator: ":",
55 inifinity: "∞",
56 currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MRU", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UYW", "UZS", "VEB", "VEF", "VES", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
57 monthsAbbreviated: []string{"", "जानेवारी", "फेब्रुवारी", "मार्च", "एप्रिल", "मे", "जून", "जुलाय", "आगोस्त", "सप्टेंबर", "ऑक्टोबर", "नोव्हेंबर", "डिसेंबर"},
58 monthsNarrow: []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
59 monthsWide: []string{"", "जानेवारी", "फेब्रुवारी", "मार्च", "एप्रिल", "मे", "जून", "जुलाय", "आगोस्त", "सप्टेंबर", "ऑक्टोबर", "नोव्हेंबर", "डिसेंबर"},
60 daysAbbreviated: []string{"आयतार", "सोमार", "मंगळार", "बुधवार", "गुरुवार", "शुक्रार", "शेनवार"},
61 daysNarrow: []string{"आ", "सो", "मं", "बु", "गु", "शु", "शे"},
62 daysShort: []string{"आय", "सोम", "मंगळ", "बुध", "गुरु", "शुक्र", "शेन"},
63 daysWide: []string{"आयतार", "सोमार", "मंगळार", "बुधवार", "गुरुवार", "शुक्रार", "शेनवार"},
64 periodsAbbreviated: []string{"AM", "PM"},
65 periodsNarrow: []string{"a", "p"},
66 periodsWide: []string{"AM", "PM"},
67 erasAbbreviated: []string{"क्रिस्तपूर्व", "क्रिस्तशखा"},
68 erasNarrow: []string{"", ""},
69 erasWide: []string{"क्रिस्तपूर्व", "क्रिस्तशखा"},
70 timezones: map[string]string{"ACDT": "ऑस्ट्रेलीयन मध्य डेलायट वेळ", "ACST": "ऑस्ट्रेलीयन मध्य प्रमाणित वेळ", "ACWDT": "ऑस्ट्रेलीयन मध्य अस्तंत डेलायट वेळ", "ACWST": "ऑस्ट्रेलीयन मध्य अस्तंत प्रमाणित वेळ", "ADT": "अटलांटीक डेलायट वेळ", "AEDT": "ऑस्ट्रेलीयन उदेंत डेलायट वेळ", "AEST": "ऑस्ट्रेलीयन उदेंत प्रमाणित वेळ", "AKDT": "अलास्का डेलायट वेळ", "AKST": "अलास्का प्रमाणित वेळ", "ARST": "अर्जेंटिना ग्रीष्म वेळ", "ART": "अर्जेंटिना प्रमाणित वेळ", "AST": "अटलांटीक प्रमाणित वेळ", "AWDT": "ऑस्ट्रेलीयन अस्तंत डेलायट वेळ", "AWST": "ऑस्ट्रेलीयन अस्तंत प्रमाणित वेळ", "BOT": "बोलिव्हिया वेळ", "BT": "भूतान", "CAT": "मध्य आफ्रिका वेळ", "CDT": "मध्य डेलायट वेळ", "CHADT": "चॅथम डेलायट वेळ", "CHAST": "चॅथम प्रमाणित वेळ", "CLST": "चिली ग्रीष्म वेळ", "CLT": "चिली प्रमाणित वेळ", "COST": "कोलंबिया ग्रीष्म वेळ", "COT": "कोलंबिया प्रमाणित वेळ", "CST": "मध्य प्रमाणित वेळ", "ChST": "कॅमोरा प्रमाणित वेळ", "EAT": "उदेंत आफ्रिका वेळ", "ECT": "इक्वेडोर वेळ", "EDT": "उदेंत डेलायट वेळ", "EST": "उदेंत प्रमाणित वेळ", "GFT": "फ्रेंच गयाना वेळ", "GMT": "ग्रीनविच मध्यc वेळ", "GST": "गल्फ प्रमाणित वेळ", "GYT": "गुयाना वेळ", "HADT": "हवाई-अलेयुशिन डेलायट वेळ", "HAST": "हवाई-अलेयुशिन प्रमाणित वेळ", "HAT": "न्युफावंडलँड डेलायट वेळ", "HECU": "क्युबा डेलायट वेळ", "HEEG": "उदेंत ग्रीनलँड ग्रीष्म वेळ", "HENOMX": "वायव्य मेक्सिको डेलायट वेळ", "HEOG": "अस्तंत ग्रीनलँड ग्रीष्म वेळ", "HEPM": "सेंट पियर आनी मिकलान डेलायट वेळ", "HEPMX": "मेक्सिकन प्रशांत डेलायट वेळ", "HKST": "हाँग काँग ग्रीष्म वेळ", "HKT": "हाँग काँग प्रमाणित वेळ", "HNCU": "क्युबा प्रमाणित वेळ", "HNEG": "उदेंत ग्रीनलँड प्रमाणित वेळ", "HNNOMX": "वायव्य मेक्सिको प्रमाणित वेळ", "HNOG": "अस्तंत ग्रीनलँड प्रमाणित वेळ", "HNPM": "सेंट पियर आनी मिकलान प्रमाणित वेळ", "HNPMX": "मेक्सिकन प्रशांत प्रमाणित वेळ", "HNT": "न्युफावंडलँड प्रमाणित वेळ", "IST": "भारतीय प्रमाणित वेळ", "JDT": "जपान डेलायट वेळ", "JST": "जपान प्रमाणित वेळ", "LHDT": "लॉर्ड होवे डेलायट वेळ", "LHST": "लॉर्ड होवे प्रमाणित वेळ", "MDT": "पर्वतीय डेलायट वेळ", "MESZ": "मध्य युवरोपियन ग्रीष्म वेळ", "MEZ": "मध्य युरोपियन प्रमाणित वेळ", "MST": "पर्वतीय प्रमाणित वेळ", "MYT": "मलेशिया वेळ", "NZDT": "न्युझीलॅन्ड डेलायट वेळ", "NZST": "न्युझीलॅन्ड प्रमाणित वेळ", "OESZ": "उदेंत युरोपियन ग्रीष्म वेळ", "OEZ": "उदेंत युरोपियन प्रमाणित वेळ", "PDT": "प्रशांत डेलायट वेळ", "PST": "प्रशांत प्रमाणित वेळ", "SAST": "दक्षिण आफ्रिका प्रमाणित वेळ", "SGT": "सिंगापूर प्रमाणित वेळ", "SRT": "सुरिनाम वेळ", "TMST": "तुर्कमेनिस्तान ग्रीष्म वेळ", "TMT": "तुर्कमेनिस्तान प्रमाणित वेळ", "UYST": "उरुग्वे ग्रीष्म वेळ", "UYT": "उरुग्वे प्रमाणित वेळ", "VET": "वेनेझुएला वेळ", "WARST": "अस्तंत अर्जेंटिना ग्रीष्म वेळ", "WART": "अस्तंत अर्जेंटिना प्रमाणित वेळ", "WAST": "अस्तंत आफ्रिका ग्रीष्म वेळ", "WAT": "अस्तंत आफ्रिका प्रमाणित वेळ", "WESZ": "अस्तंत युरोपियन ग्रीष्म वेळ", "WEZ": "अस्तंत युरोपियन प्रमाणित वेळ", "WIB": "अस्तंत इंडोनेशिया वेळ", "WIT": "उदेंत इंडोनेशिया वेळ", "WITA": "मध्य इंडोनेशिया वेळ", "∅∅∅": "अझोरेस ग्रीष्म वेळ"},
71 }
72 }
73
74
75 func (kok *kok_IN) Locale() string {
76 return kok.locale
77 }
78
79
80 func (kok *kok_IN) PluralsCardinal() []locales.PluralRule {
81 return kok.pluralsCardinal
82 }
83
84
85 func (kok *kok_IN) PluralsOrdinal() []locales.PluralRule {
86 return kok.pluralsOrdinal
87 }
88
89
90 func (kok *kok_IN) PluralsRange() []locales.PluralRule {
91 return kok.pluralsRange
92 }
93
94
95 func (kok *kok_IN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
96 return locales.PluralRuleUnknown
97 }
98
99
100 func (kok *kok_IN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
101 return locales.PluralRuleUnknown
102 }
103
104
105 func (kok *kok_IN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
106 return locales.PluralRuleUnknown
107 }
108
109
110 func (kok *kok_IN) MonthAbbreviated(month time.Month) string {
111 return kok.monthsAbbreviated[month]
112 }
113
114
115 func (kok *kok_IN) MonthsAbbreviated() []string {
116 return kok.monthsAbbreviated[1:]
117 }
118
119
120 func (kok *kok_IN) MonthNarrow(month time.Month) string {
121 return kok.monthsNarrow[month]
122 }
123
124
125 func (kok *kok_IN) MonthsNarrow() []string {
126 return kok.monthsNarrow[1:]
127 }
128
129
130 func (kok *kok_IN) MonthWide(month time.Month) string {
131 return kok.monthsWide[month]
132 }
133
134
135 func (kok *kok_IN) MonthsWide() []string {
136 return kok.monthsWide[1:]
137 }
138
139
140 func (kok *kok_IN) WeekdayAbbreviated(weekday time.Weekday) string {
141 return kok.daysAbbreviated[weekday]
142 }
143
144
145 func (kok *kok_IN) WeekdaysAbbreviated() []string {
146 return kok.daysAbbreviated
147 }
148
149
150 func (kok *kok_IN) WeekdayNarrow(weekday time.Weekday) string {
151 return kok.daysNarrow[weekday]
152 }
153
154
155 func (kok *kok_IN) WeekdaysNarrow() []string {
156 return kok.daysNarrow
157 }
158
159
160 func (kok *kok_IN) WeekdayShort(weekday time.Weekday) string {
161 return kok.daysShort[weekday]
162 }
163
164
165 func (kok *kok_IN) WeekdaysShort() []string {
166 return kok.daysShort
167 }
168
169
170 func (kok *kok_IN) WeekdayWide(weekday time.Weekday) string {
171 return kok.daysWide[weekday]
172 }
173
174
175 func (kok *kok_IN) WeekdaysWide() []string {
176 return kok.daysWide
177 }
178
179
180 func (kok *kok_IN) Decimal() string {
181 return kok.decimal
182 }
183
184
185 func (kok *kok_IN) Group() string {
186 return kok.group
187 }
188
189
190 func (kok *kok_IN) Minus() string {
191 return kok.minus
192 }
193
194
195 func (kok *kok_IN) FmtNumber(num float64, v uint64) string {
196
197 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
198 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
199 count := 0
200 inWhole := v == 0
201 b := make([]byte, 0, l)
202
203 for i := len(s) - 1; i >= 0; i-- {
204
205 if s[i] == '.' {
206 b = append(b, kok.decimal[0])
207 inWhole = true
208 continue
209 }
210
211 if inWhole {
212 if count == 3 {
213 b = append(b, kok.group[0])
214 count = 1
215 } else {
216 count++
217 }
218 }
219
220 b = append(b, s[i])
221 }
222
223 if num < 0 {
224 b = append(b, kok.minus[0])
225 }
226
227
228 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
229 b[i], b[j] = b[j], b[i]
230 }
231
232 return string(b)
233 }
234
235
236
237 func (kok *kok_IN) FmtPercent(num float64, v uint64) string {
238 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
239 l := len(s) + 3
240 b := make([]byte, 0, l)
241
242 for i := len(s) - 1; i >= 0; i-- {
243
244 if s[i] == '.' {
245 b = append(b, kok.decimal[0])
246 continue
247 }
248
249 b = append(b, s[i])
250 }
251
252 if num < 0 {
253 b = append(b, kok.minus[0])
254 }
255
256
257 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
258 b[i], b[j] = b[j], b[i]
259 }
260
261 b = append(b, kok.percent...)
262
263 return string(b)
264 }
265
266
267 func (kok *kok_IN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
268
269 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
270 symbol := kok.currencies[currency]
271 l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
272 count := 0
273 inWhole := v == 0
274 b := make([]byte, 0, l)
275
276 for i := len(s) - 1; i >= 0; i-- {
277
278 if s[i] == '.' {
279 b = append(b, kok.decimal[0])
280 inWhole = true
281 continue
282 }
283
284 if inWhole {
285 if count == 3 {
286 b = append(b, kok.group[0])
287 count = 1
288 } else {
289 count++
290 }
291 }
292
293 b = append(b, s[i])
294 }
295
296 for j := len(symbol) - 1; j >= 0; j-- {
297 b = append(b, symbol[j])
298 }
299
300 if num < 0 {
301 b = append(b, kok.minus[0])
302 }
303
304
305 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
306 b[i], b[j] = b[j], b[i]
307 }
308
309 if int(v) < 2 {
310
311 if v == 0 {
312 b = append(b, kok.decimal...)
313 }
314
315 for i := 0; i < 2-int(v); i++ {
316 b = append(b, '0')
317 }
318 }
319
320 return string(b)
321 }
322
323
324
325 func (kok *kok_IN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
326
327 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
328 symbol := kok.currencies[currency]
329 l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
330 count := 0
331 inWhole := v == 0
332 b := make([]byte, 0, l)
333
334 for i := len(s) - 1; i >= 0; i-- {
335
336 if s[i] == '.' {
337 b = append(b, kok.decimal[0])
338 inWhole = true
339 continue
340 }
341
342 if inWhole {
343 if count == 3 {
344 b = append(b, kok.group[0])
345 count = 1
346 } else {
347 count++
348 }
349 }
350
351 b = append(b, s[i])
352 }
353
354 if num < 0 {
355
356 for j := len(symbol) - 1; j >= 0; j-- {
357 b = append(b, symbol[j])
358 }
359
360 b = append(b, kok.minus[0])
361
362 } else {
363
364 for j := len(symbol) - 1; j >= 0; j-- {
365 b = append(b, symbol[j])
366 }
367
368 }
369
370
371 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
372 b[i], b[j] = b[j], b[i]
373 }
374
375 if int(v) < 2 {
376
377 if v == 0 {
378 b = append(b, kok.decimal...)
379 }
380
381 for i := 0; i < 2-int(v); i++ {
382 b = append(b, '0')
383 }
384 }
385
386 return string(b)
387 }
388
389
390 func (kok *kok_IN) FmtDateShort(t time.Time) string {
391
392 b := make([]byte, 0, 32)
393
394 b = strconv.AppendInt(b, int64(t.Day()), 10)
395 b = append(b, []byte{0x2d}...)
396 b = strconv.AppendInt(b, int64(t.Month()), 10)
397 b = append(b, []byte{0x2d}...)
398
399 if t.Year() > 9 {
400 b = append(b, strconv.Itoa(t.Year())[2:]...)
401 } else {
402 b = append(b, strconv.Itoa(t.Year())[1:]...)
403 }
404
405 return string(b)
406 }
407
408
409 func (kok *kok_IN) FmtDateMedium(t time.Time) string {
410
411 b := make([]byte, 0, 32)
412
413 if t.Day() < 10 {
414 b = append(b, '0')
415 }
416
417 b = strconv.AppendInt(b, int64(t.Day()), 10)
418 b = append(b, []byte{0x2d}...)
419
420 if t.Month() < 10 {
421 b = append(b, '0')
422 }
423
424 b = strconv.AppendInt(b, int64(t.Month()), 10)
425
426 b = append(b, []byte{0x2d}...)
427
428 if t.Year() > 0 {
429 b = strconv.AppendInt(b, int64(t.Year()), 10)
430 } else {
431 b = strconv.AppendInt(b, int64(-t.Year()), 10)
432 }
433
434 return string(b)
435 }
436
437
438 func (kok *kok_IN) FmtDateLong(t time.Time) string {
439
440 b := make([]byte, 0, 32)
441
442 b = strconv.AppendInt(b, int64(t.Day()), 10)
443 b = append(b, []byte{0x20}...)
444 b = append(b, kok.monthsWide[t.Month()]...)
445 b = append(b, []byte{0x20}...)
446
447 if t.Year() > 0 {
448 b = strconv.AppendInt(b, int64(t.Year()), 10)
449 } else {
450 b = strconv.AppendInt(b, int64(-t.Year()), 10)
451 }
452
453 return string(b)
454 }
455
456
457 func (kok *kok_IN) FmtDateFull(t time.Time) string {
458
459 b := make([]byte, 0, 32)
460
461 b = append(b, kok.daysWide[t.Weekday()]...)
462 b = append(b, []byte{0x20}...)
463 b = strconv.AppendInt(b, int64(t.Day()), 10)
464 b = append(b, []byte{0x20}...)
465 b = append(b, kok.monthsWide[t.Month()]...)
466 b = append(b, []byte{0x20}...)
467
468 if t.Year() > 0 {
469 b = strconv.AppendInt(b, int64(t.Year()), 10)
470 } else {
471 b = strconv.AppendInt(b, int64(-t.Year()), 10)
472 }
473
474 return string(b)
475 }
476
477
478 func (kok *kok_IN) FmtTimeShort(t time.Time) string {
479
480 b := make([]byte, 0, 32)
481
482 h := t.Hour()
483
484 if h > 12 {
485 h -= 12
486 }
487
488 b = strconv.AppendInt(b, int64(h), 10)
489 b = append(b, kok.timeSeparator...)
490
491 if t.Minute() < 10 {
492 b = append(b, '0')
493 }
494
495 b = strconv.AppendInt(b, int64(t.Minute()), 10)
496 b = append(b, []byte{0x20}...)
497
498 if t.Hour() < 12 {
499 b = append(b, kok.periodsAbbreviated[0]...)
500 } else {
501 b = append(b, kok.periodsAbbreviated[1]...)
502 }
503
504 return string(b)
505 }
506
507
508 func (kok *kok_IN) FmtTimeMedium(t time.Time) string {
509
510 b := make([]byte, 0, 32)
511
512 h := t.Hour()
513
514 if h > 12 {
515 h -= 12
516 }
517
518 b = strconv.AppendInt(b, int64(h), 10)
519 b = append(b, kok.timeSeparator...)
520
521 if t.Minute() < 10 {
522 b = append(b, '0')
523 }
524
525 b = strconv.AppendInt(b, int64(t.Minute()), 10)
526 b = append(b, kok.timeSeparator...)
527
528 if t.Second() < 10 {
529 b = append(b, '0')
530 }
531
532 b = strconv.AppendInt(b, int64(t.Second()), 10)
533 b = append(b, []byte{0x20}...)
534
535 if t.Hour() < 12 {
536 b = append(b, kok.periodsAbbreviated[0]...)
537 } else {
538 b = append(b, kok.periodsAbbreviated[1]...)
539 }
540
541 return string(b)
542 }
543
544
545 func (kok *kok_IN) FmtTimeLong(t time.Time) string {
546
547 b := make([]byte, 0, 32)
548
549 h := t.Hour()
550
551 if h > 12 {
552 h -= 12
553 }
554
555 b = strconv.AppendInt(b, int64(h), 10)
556 b = append(b, kok.timeSeparator...)
557
558 if t.Minute() < 10 {
559 b = append(b, '0')
560 }
561
562 b = strconv.AppendInt(b, int64(t.Minute()), 10)
563 b = append(b, kok.timeSeparator...)
564
565 if t.Second() < 10 {
566 b = append(b, '0')
567 }
568
569 b = strconv.AppendInt(b, int64(t.Second()), 10)
570 b = append(b, []byte{0x20}...)
571
572 if t.Hour() < 12 {
573 b = append(b, kok.periodsAbbreviated[0]...)
574 } else {
575 b = append(b, kok.periodsAbbreviated[1]...)
576 }
577
578 b = append(b, []byte{0x20}...)
579
580 tz, _ := t.Zone()
581 b = append(b, tz...)
582
583 return string(b)
584 }
585
586
587 func (kok *kok_IN) FmtTimeFull(t time.Time) string {
588
589 b := make([]byte, 0, 32)
590
591 h := t.Hour()
592
593 if h > 12 {
594 h -= 12
595 }
596
597 b = strconv.AppendInt(b, int64(h), 10)
598 b = append(b, kok.timeSeparator...)
599
600 if t.Minute() < 10 {
601 b = append(b, '0')
602 }
603
604 b = strconv.AppendInt(b, int64(t.Minute()), 10)
605 b = append(b, kok.timeSeparator...)
606
607 if t.Second() < 10 {
608 b = append(b, '0')
609 }
610
611 b = strconv.AppendInt(b, int64(t.Second()), 10)
612 b = append(b, []byte{0x20}...)
613
614 if t.Hour() < 12 {
615 b = append(b, kok.periodsAbbreviated[0]...)
616 } else {
617 b = append(b, kok.periodsAbbreviated[1]...)
618 }
619
620 b = append(b, []byte{0x20}...)
621
622 tz, _ := t.Zone()
623
624 if btz, ok := kok.timezones[tz]; ok {
625 b = append(b, btz...)
626 } else {
627 b = append(b, tz...)
628 }
629
630 return string(b)
631 }
632
View as plain text