OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / kok / kok.go
1 package kok
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 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 // idx = enum of currency code
25         currencyPositivePrefix string
26         currencyNegativePrefix string
27         monthsAbbreviated      []string
28         monthsNarrow           []string
29         monthsWide             []string
30         daysAbbreviated        []string
31         daysNarrow             []string
32         daysShort              []string
33         daysWide               []string
34         periodsAbbreviated     []string
35         periodsNarrow          []string
36         periodsShort           []string
37         periodsWide            []string
38         erasAbbreviated        []string
39         erasNarrow             []string
40         erasWide               []string
41         timezones              map[string]string
42 }
43
44 // New returns a new instance of translator for the 'kok' locale
45 func New() locales.Translator {
46         return &kok{
47                 locale:                 "kok",
48                 pluralsCardinal:        nil,
49                 pluralsOrdinal:         nil,
50                 pluralsRange:           nil,
51                 timeSeparator:          ":",
52                 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", "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", "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", "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", "UZS", "VEB", "VEF", "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"},
53                 currencyPositivePrefix: " ",
54                 currencyNegativePrefix: " ",
55                 monthsWide:             []string{"", "जानेवारी", "फेब्रुवारी", "मार्च", "एप्रिल", "मे", "जून", "जुलै", "ओगस्ट", "सेप्टेंबर", "ओक्टोबर", "नोव्हेंबर", "डिसेंबर"},
56                 daysAbbreviated:        []string{"रवि", "सोम", "मंगळ", "बुध", "गुरु", "शुक्र", "शनि"},
57                 daysWide:               []string{"आदित्यवार", "सोमवार", "मंगळार", "बुधवार", "गुरुवार", "शुक्रवार", "शनिवार"},
58                 periodsAbbreviated:     []string{"म.पू.", "म.नं."},
59                 periodsWide:            []string{"म.पू.", "म.नं."},
60                 erasAbbreviated:        []string{"क्रिस्तपूर्व", "क्रिस्तशखा"},
61                 erasNarrow:             []string{"", ""},
62                 erasWide:               []string{"", ""},
63                 timezones:              map[string]string{"SAST": "SAST", "CHAST": "CHAST", "BOT": "BOT", "WIT": "WIT", "VET": "VET", "HENOMX": "HENOMX", "IST": "भारतीय समय", "WAST": "WAST", "HKST": "HKST", "WIB": "WIB", "MST": "MST", "AST": "AST", "PST": "PST", "PDT": "PDT", "UYST": "UYST", "HNEG": "HNEG", "ACDT": "ACDT", "JDT": "JDT", "GYT": "GYT", "HNCU": "HNCU", "JST": "JST", "TMT": "TMT", "OEZ": "OEZ", "HNOG": "HNOG", "HEEG": "HEEG", "UYT": "UYT", "ACWST": "ACWST", "EDT": "EDT", "HNPM": "HNPM", "MYT": "MYT", "HAT": "HAT", "ECT": "ECT", "AKST": "AKST", "CDT": "CDT", "ARST": "ARST", "HEOG": "HEOG", "ADT": "ADT", "HNT": "HNT", "NZST": "NZST", "GMT": "GMT", "MDT": "MDT", "HAST": "HAST", "WART": "WART", "AWDT": "AWDT", "MEZ": "MEZ", "COST": "COST", "AKDT": "AKDT", "CAT": "CAT", "ChST": "ChST", "AEST": "AEST", "HADT": "HADT", "TMST": "TMST", "HNNOMX": "HNNOMX", "OESZ": "OESZ", "CLT": "CLT", "EST": "EST", "HECU": "HECU", "ACWDT": "ACWDT", "LHST": "LHST", "EAT": "EAT", "HEPM": "HEPM", "BT": "BT", "AWST": "AWST", "HNPMX": "HNPMX", "CST": "CST", "MESZ": "MESZ", "WARST": "WARST", "ART": "ART", "CLST": "CLST", "∅∅∅": "∅∅∅", "SGT": "SGT", "WITA": "WITA", "WESZ": "WESZ", "SRT": "SRT", "NZDT": "NZDT", "LHDT": "LHDT", "AEDT": "AEDT", "HKT": "HKT", "COT": "COT", "GFT": "GFT", "CHADT": "CHADT", "WAT": "WAT", "ACST": "ACST", "WEZ": "WEZ", "HEPMX": "HEPMX"},
64         }
65 }
66
67 // Locale returns the current translators string locale
68 func (kok *kok) Locale() string {
69         return kok.locale
70 }
71
72 // PluralsCardinal returns the list of cardinal plural rules associated with 'kok'
73 func (kok *kok) PluralsCardinal() []locales.PluralRule {
74         return kok.pluralsCardinal
75 }
76
77 // PluralsOrdinal returns the list of ordinal plural rules associated with 'kok'
78 func (kok *kok) PluralsOrdinal() []locales.PluralRule {
79         return kok.pluralsOrdinal
80 }
81
82 // PluralsRange returns the list of range plural rules associated with 'kok'
83 func (kok *kok) PluralsRange() []locales.PluralRule {
84         return kok.pluralsRange
85 }
86
87 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'kok'
88 func (kok *kok) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
89         return locales.PluralRuleUnknown
90 }
91
92 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'kok'
93 func (kok *kok) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
94         return locales.PluralRuleUnknown
95 }
96
97 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'kok'
98 func (kok *kok) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
99         return locales.PluralRuleUnknown
100 }
101
102 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
103 func (kok *kok) MonthAbbreviated(month time.Month) string {
104         return kok.monthsAbbreviated[month]
105 }
106
107 // MonthsAbbreviated returns the locales abbreviated months
108 func (kok *kok) MonthsAbbreviated() []string {
109         return nil
110 }
111
112 // MonthNarrow returns the locales narrow month given the 'month' provided
113 func (kok *kok) MonthNarrow(month time.Month) string {
114         return kok.monthsNarrow[month]
115 }
116
117 // MonthsNarrow returns the locales narrow months
118 func (kok *kok) MonthsNarrow() []string {
119         return nil
120 }
121
122 // MonthWide returns the locales wide month given the 'month' provided
123 func (kok *kok) MonthWide(month time.Month) string {
124         return kok.monthsWide[month]
125 }
126
127 // MonthsWide returns the locales wide months
128 func (kok *kok) MonthsWide() []string {
129         return kok.monthsWide[1:]
130 }
131
132 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
133 func (kok *kok) WeekdayAbbreviated(weekday time.Weekday) string {
134         return kok.daysAbbreviated[weekday]
135 }
136
137 // WeekdaysAbbreviated returns the locales abbreviated weekdays
138 func (kok *kok) WeekdaysAbbreviated() []string {
139         return kok.daysAbbreviated
140 }
141
142 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
143 func (kok *kok) WeekdayNarrow(weekday time.Weekday) string {
144         return kok.daysNarrow[weekday]
145 }
146
147 // WeekdaysNarrow returns the locales narrow weekdays
148 func (kok *kok) WeekdaysNarrow() []string {
149         return kok.daysNarrow
150 }
151
152 // WeekdayShort returns the locales short weekday given the 'weekday' provided
153 func (kok *kok) WeekdayShort(weekday time.Weekday) string {
154         return kok.daysShort[weekday]
155 }
156
157 // WeekdaysShort returns the locales short weekdays
158 func (kok *kok) WeekdaysShort() []string {
159         return kok.daysShort
160 }
161
162 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
163 func (kok *kok) WeekdayWide(weekday time.Weekday) string {
164         return kok.daysWide[weekday]
165 }
166
167 // WeekdaysWide returns the locales wide weekdays
168 func (kok *kok) WeekdaysWide() []string {
169         return kok.daysWide
170 }
171
172 // Decimal returns the decimal point of number
173 func (kok *kok) Decimal() string {
174         return kok.decimal
175 }
176
177 // Group returns the group of number
178 func (kok *kok) Group() string {
179         return kok.group
180 }
181
182 // Group returns the minus sign of number
183 func (kok *kok) Minus() string {
184         return kok.minus
185 }
186
187 // FmtNumber returns 'num' with digits/precision of 'v' for 'kok' and handles both Whole and Real numbers based on 'v'
188 func (kok *kok) FmtNumber(num float64, v uint64) string {
189
190         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
191         l := len(s) + 0
192         count := 0
193         inWhole := v == 0
194         inSecondary := false
195         groupThreshold := 3
196
197         b := make([]byte, 0, l)
198
199         for i := len(s) - 1; i >= 0; i-- {
200
201                 if s[i] == '.' {
202                         b = append(b, kok.decimal[0])
203                         inWhole = true
204                         continue
205                 }
206
207                 if inWhole {
208
209                         if count == groupThreshold {
210                                 b = append(b, kok.group[0])
211                                 count = 1
212
213                                 if !inSecondary {
214                                         inSecondary = true
215                                         groupThreshold = 2
216                                 }
217                         } else {
218                                 count++
219                         }
220                 }
221
222                 b = append(b, s[i])
223         }
224
225         if num < 0 {
226                 b = append(b, kok.minus[0])
227         }
228
229         // reverse
230         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
231                 b[i], b[j] = b[j], b[i]
232         }
233
234         return string(b)
235 }
236
237 // FmtPercent returns 'num' with digits/precision of 'v' for 'kok' and handles both Whole and Real numbers based on 'v'
238 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
239 func (kok *kok) FmtPercent(num float64, v uint64) string {
240         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
241         l := len(s) + 0
242         b := make([]byte, 0, l)
243
244         for i := len(s) - 1; i >= 0; i-- {
245
246                 if s[i] == '.' {
247                         b = append(b, kok.decimal[0])
248                         continue
249                 }
250
251                 b = append(b, s[i])
252         }
253
254         if num < 0 {
255                 b = append(b, kok.minus[0])
256         }
257
258         // reverse
259         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
260                 b[i], b[j] = b[j], b[i]
261         }
262
263         b = append(b, kok.percent...)
264
265         return string(b)
266 }
267
268 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'kok'
269 func (kok *kok) FmtCurrency(num float64, v uint64, currency currency.Type) string {
270
271         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
272         symbol := kok.currencies[currency]
273         l := len(s) + len(symbol) + 2
274         count := 0
275         inWhole := v == 0
276         inSecondary := false
277         groupThreshold := 3
278
279         b := make([]byte, 0, l)
280
281         for i := len(s) - 1; i >= 0; i-- {
282
283                 if s[i] == '.' {
284                         b = append(b, kok.decimal[0])
285                         inWhole = true
286                         continue
287                 }
288
289                 if inWhole {
290
291                         if count == groupThreshold {
292                                 b = append(b, kok.group[0])
293                                 count = 1
294
295                                 if !inSecondary {
296                                         inSecondary = true
297                                         groupThreshold = 2
298                                 }
299                         } else {
300                                 count++
301                         }
302                 }
303
304                 b = append(b, s[i])
305         }
306
307         for j := len(symbol) - 1; j >= 0; j-- {
308                 b = append(b, symbol[j])
309         }
310
311         for j := len(kok.currencyPositivePrefix) - 1; j >= 0; j-- {
312                 b = append(b, kok.currencyPositivePrefix[j])
313         }
314
315         if num < 0 {
316                 b = append(b, kok.minus[0])
317         }
318
319         // reverse
320         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
321                 b[i], b[j] = b[j], b[i]
322         }
323
324         if int(v) < 2 {
325
326                 if v == 0 {
327                         b = append(b, kok.decimal...)
328                 }
329
330                 for i := 0; i < 2-int(v); i++ {
331                         b = append(b, '0')
332                 }
333         }
334
335         return string(b)
336 }
337
338 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'kok'
339 // in accounting notation.
340 func (kok *kok) FmtAccounting(num float64, v uint64, currency currency.Type) string {
341
342         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
343         symbol := kok.currencies[currency]
344         l := len(s) + len(symbol) + 2
345         count := 0
346         inWhole := v == 0
347         inSecondary := false
348         groupThreshold := 3
349
350         b := make([]byte, 0, l)
351
352         for i := len(s) - 1; i >= 0; i-- {
353
354                 if s[i] == '.' {
355                         b = append(b, kok.decimal[0])
356                         inWhole = true
357                         continue
358                 }
359
360                 if inWhole {
361
362                         if count == groupThreshold {
363                                 b = append(b, kok.group[0])
364                                 count = 1
365
366                                 if !inSecondary {
367                                         inSecondary = true
368                                         groupThreshold = 2
369                                 }
370                         } else {
371                                 count++
372                         }
373                 }
374
375                 b = append(b, s[i])
376         }
377
378         if num < 0 {
379
380                 for j := len(symbol) - 1; j >= 0; j-- {
381                         b = append(b, symbol[j])
382                 }
383
384                 for j := len(kok.currencyNegativePrefix) - 1; j >= 0; j-- {
385                         b = append(b, kok.currencyNegativePrefix[j])
386                 }
387
388                 b = append(b, kok.minus[0])
389
390         } else {
391
392                 for j := len(symbol) - 1; j >= 0; j-- {
393                         b = append(b, symbol[j])
394                 }
395
396                 for j := len(kok.currencyPositivePrefix) - 1; j >= 0; j-- {
397                         b = append(b, kok.currencyPositivePrefix[j])
398                 }
399
400         }
401
402         // reverse
403         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
404                 b[i], b[j] = b[j], b[i]
405         }
406
407         if int(v) < 2 {
408
409                 if v == 0 {
410                         b = append(b, kok.decimal...)
411                 }
412
413                 for i := 0; i < 2-int(v); i++ {
414                         b = append(b, '0')
415                 }
416         }
417
418         return string(b)
419 }
420
421 // FmtDateShort returns the short date representation of 't' for 'kok'
422 func (kok *kok) FmtDateShort(t time.Time) string {
423
424         b := make([]byte, 0, 32)
425
426         b = strconv.AppendInt(b, int64(t.Day()), 10)
427         b = append(b, []byte{0x2d}...)
428         b = strconv.AppendInt(b, int64(t.Month()), 10)
429         b = append(b, []byte{0x2d}...)
430
431         if t.Year() > 9 {
432                 b = append(b, strconv.Itoa(t.Year())[2:]...)
433         } else {
434                 b = append(b, strconv.Itoa(t.Year())[1:]...)
435         }
436
437         return string(b)
438 }
439
440 // FmtDateMedium returns the medium date representation of 't' for 'kok'
441 func (kok *kok) FmtDateMedium(t time.Time) string {
442
443         b := make([]byte, 0, 32)
444
445         if t.Day() < 10 {
446                 b = append(b, '0')
447         }
448
449         b = strconv.AppendInt(b, int64(t.Day()), 10)
450         b = append(b, []byte{0x2d}...)
451
452         if t.Month() < 10 {
453                 b = append(b, '0')
454         }
455
456         b = strconv.AppendInt(b, int64(t.Month()), 10)
457
458         b = append(b, []byte{0x2d}...)
459
460         if t.Year() > 0 {
461                 b = strconv.AppendInt(b, int64(t.Year()), 10)
462         } else {
463                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
464         }
465
466         return string(b)
467 }
468
469 // FmtDateLong returns the long date representation of 't' for 'kok'
470 func (kok *kok) FmtDateLong(t time.Time) string {
471
472         b := make([]byte, 0, 32)
473
474         b = strconv.AppendInt(b, int64(t.Day()), 10)
475         b = append(b, []byte{0x20}...)
476         b = append(b, kok.monthsWide[t.Month()]...)
477         b = append(b, []byte{0x20}...)
478
479         if t.Year() > 0 {
480                 b = strconv.AppendInt(b, int64(t.Year()), 10)
481         } else {
482                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
483         }
484
485         return string(b)
486 }
487
488 // FmtDateFull returns the full date representation of 't' for 'kok'
489 func (kok *kok) FmtDateFull(t time.Time) string {
490
491         b := make([]byte, 0, 32)
492
493         b = append(b, kok.daysWide[t.Weekday()]...)
494         b = append(b, []byte{0x20}...)
495         b = strconv.AppendInt(b, int64(t.Day()), 10)
496         b = append(b, []byte{0x20}...)
497         b = append(b, kok.monthsWide[t.Month()]...)
498         b = append(b, []byte{0x20}...)
499
500         if t.Year() > 0 {
501                 b = strconv.AppendInt(b, int64(t.Year()), 10)
502         } else {
503                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
504         }
505
506         return string(b)
507 }
508
509 // FmtTimeShort returns the short time representation of 't' for 'kok'
510 func (kok *kok) FmtTimeShort(t time.Time) string {
511
512         b := make([]byte, 0, 32)
513
514         h := t.Hour()
515
516         if h > 12 {
517                 h -= 12
518         }
519
520         b = strconv.AppendInt(b, int64(h), 10)
521         b = append(b, kok.timeSeparator...)
522
523         if t.Minute() < 10 {
524                 b = append(b, '0')
525         }
526
527         b = strconv.AppendInt(b, int64(t.Minute()), 10)
528         b = append(b, []byte{0x20}...)
529
530         if t.Hour() < 12 {
531                 b = append(b, kok.periodsAbbreviated[0]...)
532         } else {
533                 b = append(b, kok.periodsAbbreviated[1]...)
534         }
535
536         return string(b)
537 }
538
539 // FmtTimeMedium returns the medium time representation of 't' for 'kok'
540 func (kok *kok) FmtTimeMedium(t time.Time) string {
541
542         b := make([]byte, 0, 32)
543
544         h := t.Hour()
545
546         if h > 12 {
547                 h -= 12
548         }
549
550         b = strconv.AppendInt(b, int64(h), 10)
551         b = append(b, kok.timeSeparator...)
552
553         if t.Minute() < 10 {
554                 b = append(b, '0')
555         }
556
557         b = strconv.AppendInt(b, int64(t.Minute()), 10)
558         b = append(b, kok.timeSeparator...)
559
560         if t.Second() < 10 {
561                 b = append(b, '0')
562         }
563
564         b = strconv.AppendInt(b, int64(t.Second()), 10)
565         b = append(b, []byte{0x20}...)
566
567         if t.Hour() < 12 {
568                 b = append(b, kok.periodsAbbreviated[0]...)
569         } else {
570                 b = append(b, kok.periodsAbbreviated[1]...)
571         }
572
573         return string(b)
574 }
575
576 // FmtTimeLong returns the long time representation of 't' for 'kok'
577 func (kok *kok) FmtTimeLong(t time.Time) string {
578
579         b := make([]byte, 0, 32)
580
581         h := t.Hour()
582
583         if h > 12 {
584                 h -= 12
585         }
586
587         b = strconv.AppendInt(b, int64(h), 10)
588         b = append(b, kok.timeSeparator...)
589
590         if t.Minute() < 10 {
591                 b = append(b, '0')
592         }
593
594         b = strconv.AppendInt(b, int64(t.Minute()), 10)
595         b = append(b, kok.timeSeparator...)
596
597         if t.Second() < 10 {
598                 b = append(b, '0')
599         }
600
601         b = strconv.AppendInt(b, int64(t.Second()), 10)
602         b = append(b, []byte{0x20}...)
603
604         if t.Hour() < 12 {
605                 b = append(b, kok.periodsAbbreviated[0]...)
606         } else {
607                 b = append(b, kok.periodsAbbreviated[1]...)
608         }
609
610         b = append(b, []byte{0x20}...)
611
612         tz, _ := t.Zone()
613         b = append(b, tz...)
614
615         return string(b)
616 }
617
618 // FmtTimeFull returns the full time representation of 't' for 'kok'
619 func (kok *kok) FmtTimeFull(t time.Time) string {
620
621         b := make([]byte, 0, 32)
622
623         h := t.Hour()
624
625         if h > 12 {
626                 h -= 12
627         }
628
629         b = strconv.AppendInt(b, int64(h), 10)
630         b = append(b, kok.timeSeparator...)
631
632         if t.Minute() < 10 {
633                 b = append(b, '0')
634         }
635
636         b = strconv.AppendInt(b, int64(t.Minute()), 10)
637         b = append(b, kok.timeSeparator...)
638
639         if t.Second() < 10 {
640                 b = append(b, '0')
641         }
642
643         b = strconv.AppendInt(b, int64(t.Second()), 10)
644         b = append(b, []byte{0x20}...)
645
646         if t.Hour() < 12 {
647                 b = append(b, kok.periodsAbbreviated[0]...)
648         } else {
649                 b = append(b, kok.periodsAbbreviated[1]...)
650         }
651
652         b = append(b, []byte{0x20}...)
653
654         tz, _ := t.Zone()
655
656         if btz, ok := kok.timezones[tz]; ok {
657                 b = append(b, btz...)
658         } else {
659                 b = append(b, tz...)
660         }
661
662         return string(b)
663 }