OSDN Git Service

delete miner
[bytom/vapor.git] / vendor / github.com / go-playground / locales / kea / kea.go
1 package kea
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 kea 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         currencyPositiveSuffix string
26         currencyNegativePrefix string
27         currencyNegativeSuffix string
28         monthsAbbreviated      []string
29         monthsNarrow           []string
30         monthsWide             []string
31         daysAbbreviated        []string
32         daysNarrow             []string
33         daysShort              []string
34         daysWide               []string
35         periodsAbbreviated     []string
36         periodsNarrow          []string
37         periodsShort           []string
38         periodsWide            []string
39         erasAbbreviated        []string
40         erasNarrow             []string
41         erasWide               []string
42         timezones              map[string]string
43 }
44
45 // New returns a new instance of translator for the 'kea' locale
46 func New() locales.Translator {
47         return &kea{
48                 locale:                 "kea",
49                 pluralsCardinal:        []locales.PluralRule{6},
50                 pluralsOrdinal:         nil,
51                 pluralsRange:           nil,
52                 decimal:                ",",
53                 group:                  " ",
54                 minus:                  "-",
55                 percent:                "%",
56                 perMille:               "‰",
57                 timeSeparator:          ":",
58                 inifinity:              "∞",
59                 currencies:             []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "৳", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "$", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "\u200b", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "$", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "៛", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "₸", "₭", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "₮", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "₱", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "$", "SCR", "SDD", "SDG", "SDP", "SEK", "$", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "₺", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
60                 currencyPositiveSuffix: " ",
61                 currencyNegativePrefix: "(",
62                 currencyNegativeSuffix: " )",
63                 monthsAbbreviated:      []string{"", "Jan", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Otu", "Nuv", "Diz"},
64                 monthsNarrow:           []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
65                 monthsWide:             []string{"", "Janeru", "Febreru", "Marsu", "Abril", "Maiu", "Junhu", "Julhu", "Agostu", "Setenbru", "Otubru", "Nuvenbru", "Dizenbru"},
66                 daysAbbreviated:        []string{"dum", "sig", "ter", "kua", "kin", "ses", "sab"},
67                 daysNarrow:             []string{"D", "S", "T", "K", "K", "S", "S"},
68                 daysShort:              []string{"du", "si", "te", "ku", "ki", "se", "sa"},
69                 daysWide:               []string{"dumingu", "sigunda-fera", "tersa-fera", "kuarta-fera", "kinta-fera", "sesta-fera", "sabadu"},
70                 periodsAbbreviated:     []string{"am", "pm"},
71                 periodsNarrow:          []string{"a", "p"},
72                 periodsWide:            []string{"am", "pm"},
73                 erasAbbreviated:        []string{"AK", "DK"},
74                 erasNarrow:             []string{"", ""},
75                 erasWide:               []string{"Antis di Kristu", "Dispos di Kristu"},
76                 timezones:              map[string]string{"JDT": "JDT", "ART": "ART", "HEPMX": "HEPMX", "UYST": "UYST", "NZDT": "NZDT", "WARST": "WARST", "NZST": "NZST", "GYT": "GYT", "ACDT": "Ora di Verãu di Australia Sentral", "SGT": "SGT", "GMT": "GMT", "PDT": "Ora di Pasifiku di Verãu", "HADT": "HADT", "COT": "COT", "CAT": "Ora di Afrika Sentral", "CHADT": "CHADT", "SRT": "SRT", "WART": "WART", "ACST": "Ora Padrãu di Australia Sentral", "AKDT": "AKDT", "∅∅∅": "∅∅∅", "HNOG": "HNOG", "COST": "COST", "HNT": "HNT", "AEST": "Ora Padrãu di Australia Oriental", "SAST": "Ora di Sul di Afrika", "WIB": "WIB", "CHAST": "CHAST", "HNPM": "HNPM", "AWST": "Ora Padrãu di Australia Osidental", "JST": "JST", "AST": "Ora Padrãu di Atlantiku", "ADT": "Ora di Verãu di Atlantiku", "HAT": "HAT", "BOT": "BOT", "AWDT": "Ora di Verãu di Australia Osidental", "MYT": "MYT", "UYT": "UYT", "WAST": "Ora di Verão di Afrika Osidental", "HKST": "HKST", "CLT": "CLT", "GFT": "GFT", "HNCU": "HNCU", "MST": "MST", "AEDT": "Ora di Verãu di Australia Oriental", "HEOG": "HEOG", "ECT": "ECT", "HEEG": "HEEG", "ACWST": "Ora Padrãu di Australia Sentru-Osidental", "MESZ": "Ora di Verãu di Europa Sentral", "OESZ": "Ora di Verãu di Europa Oriental", "IST": "IST", "HNPMX": "HNPMX", "BT": "BT", "OEZ": "Ora Padrãu di Europa Oriental", "EST": "Ora Oriental Padrãu", "CLST": "CLST", "CST": "Ora Sentral Padrãu", "ACWDT": "Ora di Verãu di Australia Sentru-Osidental", "ARST": "ARST", "WAT": "Ora Padrãu di Afrika Osidental", "EAT": "Ora di Afrika Oriental", "EDT": "Ora Oriental di Verãu", "HECU": "HECU", "TMST": "TMST", "VET": "VET", "HNNOMX": "HNNOMX", "WIT": "WIT", "TMT": "TMT", "LHDT": "LHDT", "HKT": "HKT", "WITA": "WITA", "HNEG": "HNEG", "WESZ": "Ora di Verãu di Europa Osidental", "ChST": "ChST", "HEPM": "HEPM", "MDT": "MDT", "WEZ": "Ora Padrãu di Europa Osidental", "LHST": "LHST", "HAST": "HAST", "AKST": "AKST", "PST": "Ora di Pasifiku Padrãu", "CDT": "Ora Sentral di Verãu", "MEZ": "Ora Padrãu di Europa Sentral", "HENOMX": "HENOMX"},
77         }
78 }
79
80 // Locale returns the current translators string locale
81 func (kea *kea) Locale() string {
82         return kea.locale
83 }
84
85 // PluralsCardinal returns the list of cardinal plural rules associated with 'kea'
86 func (kea *kea) PluralsCardinal() []locales.PluralRule {
87         return kea.pluralsCardinal
88 }
89
90 // PluralsOrdinal returns the list of ordinal plural rules associated with 'kea'
91 func (kea *kea) PluralsOrdinal() []locales.PluralRule {
92         return kea.pluralsOrdinal
93 }
94
95 // PluralsRange returns the list of range plural rules associated with 'kea'
96 func (kea *kea) PluralsRange() []locales.PluralRule {
97         return kea.pluralsRange
98 }
99
100 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'kea'
101 func (kea *kea) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
102         return locales.PluralRuleOther
103 }
104
105 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'kea'
106 func (kea *kea) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
107         return locales.PluralRuleUnknown
108 }
109
110 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'kea'
111 func (kea *kea) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
112         return locales.PluralRuleUnknown
113 }
114
115 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
116 func (kea *kea) MonthAbbreviated(month time.Month) string {
117         return kea.monthsAbbreviated[month]
118 }
119
120 // MonthsAbbreviated returns the locales abbreviated months
121 func (kea *kea) MonthsAbbreviated() []string {
122         return kea.monthsAbbreviated[1:]
123 }
124
125 // MonthNarrow returns the locales narrow month given the 'month' provided
126 func (kea *kea) MonthNarrow(month time.Month) string {
127         return kea.monthsNarrow[month]
128 }
129
130 // MonthsNarrow returns the locales narrow months
131 func (kea *kea) MonthsNarrow() []string {
132         return kea.monthsNarrow[1:]
133 }
134
135 // MonthWide returns the locales wide month given the 'month' provided
136 func (kea *kea) MonthWide(month time.Month) string {
137         return kea.monthsWide[month]
138 }
139
140 // MonthsWide returns the locales wide months
141 func (kea *kea) MonthsWide() []string {
142         return kea.monthsWide[1:]
143 }
144
145 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
146 func (kea *kea) WeekdayAbbreviated(weekday time.Weekday) string {
147         return kea.daysAbbreviated[weekday]
148 }
149
150 // WeekdaysAbbreviated returns the locales abbreviated weekdays
151 func (kea *kea) WeekdaysAbbreviated() []string {
152         return kea.daysAbbreviated
153 }
154
155 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
156 func (kea *kea) WeekdayNarrow(weekday time.Weekday) string {
157         return kea.daysNarrow[weekday]
158 }
159
160 // WeekdaysNarrow returns the locales narrow weekdays
161 func (kea *kea) WeekdaysNarrow() []string {
162         return kea.daysNarrow
163 }
164
165 // WeekdayShort returns the locales short weekday given the 'weekday' provided
166 func (kea *kea) WeekdayShort(weekday time.Weekday) string {
167         return kea.daysShort[weekday]
168 }
169
170 // WeekdaysShort returns the locales short weekdays
171 func (kea *kea) WeekdaysShort() []string {
172         return kea.daysShort
173 }
174
175 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
176 func (kea *kea) WeekdayWide(weekday time.Weekday) string {
177         return kea.daysWide[weekday]
178 }
179
180 // WeekdaysWide returns the locales wide weekdays
181 func (kea *kea) WeekdaysWide() []string {
182         return kea.daysWide
183 }
184
185 // Decimal returns the decimal point of number
186 func (kea *kea) Decimal() string {
187         return kea.decimal
188 }
189
190 // Group returns the group of number
191 func (kea *kea) Group() string {
192         return kea.group
193 }
194
195 // Group returns the minus sign of number
196 func (kea *kea) Minus() string {
197         return kea.minus
198 }
199
200 // FmtNumber returns 'num' with digits/precision of 'v' for 'kea' and handles both Whole and Real numbers based on 'v'
201 func (kea *kea) FmtNumber(num float64, v uint64) string {
202
203         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
204         l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
205         count := 0
206         inWhole := v == 0
207         b := make([]byte, 0, l)
208
209         for i := len(s) - 1; i >= 0; i-- {
210
211                 if s[i] == '.' {
212                         b = append(b, kea.decimal[0])
213                         inWhole = true
214                         continue
215                 }
216
217                 if inWhole {
218                         if count == 3 {
219                                 for j := len(kea.group) - 1; j >= 0; j-- {
220                                         b = append(b, kea.group[j])
221                                 }
222                                 count = 1
223                         } else {
224                                 count++
225                         }
226                 }
227
228                 b = append(b, s[i])
229         }
230
231         if num < 0 {
232                 b = append(b, kea.minus[0])
233         }
234
235         // reverse
236         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
237                 b[i], b[j] = b[j], b[i]
238         }
239
240         return string(b)
241 }
242
243 // FmtPercent returns 'num' with digits/precision of 'v' for 'kea' and handles both Whole and Real numbers based on 'v'
244 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
245 func (kea *kea) FmtPercent(num float64, v uint64) string {
246         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
247         l := len(s) + 3
248         b := make([]byte, 0, l)
249
250         for i := len(s) - 1; i >= 0; i-- {
251
252                 if s[i] == '.' {
253                         b = append(b, kea.decimal[0])
254                         continue
255                 }
256
257                 b = append(b, s[i])
258         }
259
260         if num < 0 {
261                 b = append(b, kea.minus[0])
262         }
263
264         // reverse
265         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
266                 b[i], b[j] = b[j], b[i]
267         }
268
269         b = append(b, kea.percent...)
270
271         return string(b)
272 }
273
274 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'kea'
275 func (kea *kea) FmtCurrency(num float64, v uint64, currency currency.Type) string {
276
277         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
278         symbol := kea.currencies[currency]
279         l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
280         count := 0
281         inWhole := v == 0
282         b := make([]byte, 0, l)
283
284         for i := len(s) - 1; i >= 0; i-- {
285
286                 if s[i] == '.' {
287                         b = append(b, kea.decimal[0])
288                         inWhole = true
289                         continue
290                 }
291
292                 if inWhole {
293                         if count == 3 {
294                                 for j := len(kea.group) - 1; j >= 0; j-- {
295                                         b = append(b, kea.group[j])
296                                 }
297                                 count = 1
298                         } else {
299                                 count++
300                         }
301                 }
302
303                 b = append(b, s[i])
304         }
305
306         if num < 0 {
307                 b = append(b, kea.minus[0])
308         }
309
310         // reverse
311         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
312                 b[i], b[j] = b[j], b[i]
313         }
314
315         if int(v) < 2 {
316
317                 if v == 0 {
318                         b = append(b, kea.decimal...)
319                 }
320
321                 for i := 0; i < 2-int(v); i++ {
322                         b = append(b, '0')
323                 }
324         }
325
326         b = append(b, kea.currencyPositiveSuffix...)
327
328         b = append(b, symbol...)
329
330         return string(b)
331 }
332
333 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'kea'
334 // in accounting notation.
335 func (kea *kea) FmtAccounting(num float64, v uint64, currency currency.Type) string {
336
337         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
338         symbol := kea.currencies[currency]
339         l := len(s) + len(symbol) + 6 + 2*len(s[:len(s)-int(v)-1])/3
340         count := 0
341         inWhole := v == 0
342         b := make([]byte, 0, l)
343
344         for i := len(s) - 1; i >= 0; i-- {
345
346                 if s[i] == '.' {
347                         b = append(b, kea.decimal[0])
348                         inWhole = true
349                         continue
350                 }
351
352                 if inWhole {
353                         if count == 3 {
354                                 for j := len(kea.group) - 1; j >= 0; j-- {
355                                         b = append(b, kea.group[j])
356                                 }
357                                 count = 1
358                         } else {
359                                 count++
360                         }
361                 }
362
363                 b = append(b, s[i])
364         }
365
366         if num < 0 {
367
368                 b = append(b, kea.currencyNegativePrefix[0])
369
370         }
371
372         // reverse
373         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
374                 b[i], b[j] = b[j], b[i]
375         }
376
377         if int(v) < 2 {
378
379                 if v == 0 {
380                         b = append(b, kea.decimal...)
381                 }
382
383                 for i := 0; i < 2-int(v); i++ {
384                         b = append(b, '0')
385                 }
386         }
387
388         if num < 0 {
389                 b = append(b, kea.currencyNegativeSuffix...)
390                 b = append(b, symbol...)
391         } else {
392
393                 b = append(b, kea.currencyPositiveSuffix...)
394                 b = append(b, symbol...)
395         }
396
397         return string(b)
398 }
399
400 // FmtDateShort returns the short date representation of 't' for 'kea'
401 func (kea *kea) FmtDateShort(t time.Time) string {
402
403         b := make([]byte, 0, 32)
404
405         b = strconv.AppendInt(b, int64(t.Day()), 10)
406         b = append(b, []byte{0x2f}...)
407         b = strconv.AppendInt(b, int64(t.Month()), 10)
408         b = append(b, []byte{0x2f}...)
409
410         if t.Year() > 0 {
411                 b = strconv.AppendInt(b, int64(t.Year()), 10)
412         } else {
413                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
414         }
415
416         return string(b)
417 }
418
419 // FmtDateMedium returns the medium date representation of 't' for 'kea'
420 func (kea *kea) FmtDateMedium(t time.Time) string {
421
422         b := make([]byte, 0, 32)
423
424         b = strconv.AppendInt(b, int64(t.Day()), 10)
425         b = append(b, []byte{0x20}...)
426         b = append(b, kea.monthsAbbreviated[t.Month()]...)
427         b = append(b, []byte{0x20}...)
428
429         if t.Year() > 0 {
430                 b = strconv.AppendInt(b, int64(t.Year()), 10)
431         } else {
432                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
433         }
434
435         return string(b)
436 }
437
438 // FmtDateLong returns the long date representation of 't' for 'kea'
439 func (kea *kea) FmtDateLong(t time.Time) string {
440
441         b := make([]byte, 0, 32)
442
443         b = strconv.AppendInt(b, int64(t.Day()), 10)
444         b = append(b, []byte{0x20, 0x64, 0x69}...)
445         b = append(b, []byte{0x20}...)
446         b = append(b, kea.monthsWide[t.Month()]...)
447         b = append(b, []byte{0x20, 0x64, 0x69}...)
448         b = append(b, []byte{0x20}...)
449
450         if t.Year() > 0 {
451                 b = strconv.AppendInt(b, int64(t.Year()), 10)
452         } else {
453                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
454         }
455
456         return string(b)
457 }
458
459 // FmtDateFull returns the full date representation of 't' for 'kea'
460 func (kea *kea) FmtDateFull(t time.Time) string {
461
462         b := make([]byte, 0, 32)
463
464         b = append(b, kea.daysWide[t.Weekday()]...)
465         b = append(b, []byte{0x2c, 0x20}...)
466         b = strconv.AppendInt(b, int64(t.Day()), 10)
467         b = append(b, []byte{0x20, 0x64, 0x69}...)
468         b = append(b, []byte{0x20}...)
469         b = append(b, kea.monthsWide[t.Month()]...)
470         b = append(b, []byte{0x20, 0x64, 0x69}...)
471         b = append(b, []byte{0x20}...)
472
473         if t.Year() > 0 {
474                 b = strconv.AppendInt(b, int64(t.Year()), 10)
475         } else {
476                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
477         }
478
479         return string(b)
480 }
481
482 // FmtTimeShort returns the short time representation of 't' for 'kea'
483 func (kea *kea) FmtTimeShort(t time.Time) string {
484
485         b := make([]byte, 0, 32)
486
487         if t.Hour() < 10 {
488                 b = append(b, '0')
489         }
490
491         b = strconv.AppendInt(b, int64(t.Hour()), 10)
492         b = append(b, kea.timeSeparator...)
493
494         if t.Minute() < 10 {
495                 b = append(b, '0')
496         }
497
498         b = strconv.AppendInt(b, int64(t.Minute()), 10)
499
500         return string(b)
501 }
502
503 // FmtTimeMedium returns the medium time representation of 't' for 'kea'
504 func (kea *kea) FmtTimeMedium(t time.Time) string {
505
506         b := make([]byte, 0, 32)
507
508         if t.Hour() < 10 {
509                 b = append(b, '0')
510         }
511
512         b = strconv.AppendInt(b, int64(t.Hour()), 10)
513         b = append(b, kea.timeSeparator...)
514
515         if t.Minute() < 10 {
516                 b = append(b, '0')
517         }
518
519         b = strconv.AppendInt(b, int64(t.Minute()), 10)
520         b = append(b, kea.timeSeparator...)
521
522         if t.Second() < 10 {
523                 b = append(b, '0')
524         }
525
526         b = strconv.AppendInt(b, int64(t.Second()), 10)
527
528         return string(b)
529 }
530
531 // FmtTimeLong returns the long time representation of 't' for 'kea'
532 func (kea *kea) FmtTimeLong(t time.Time) string {
533
534         b := make([]byte, 0, 32)
535
536         if t.Hour() < 10 {
537                 b = append(b, '0')
538         }
539
540         b = strconv.AppendInt(b, int64(t.Hour()), 10)
541         b = append(b, kea.timeSeparator...)
542
543         if t.Minute() < 10 {
544                 b = append(b, '0')
545         }
546
547         b = strconv.AppendInt(b, int64(t.Minute()), 10)
548         b = append(b, kea.timeSeparator...)
549
550         if t.Second() < 10 {
551                 b = append(b, '0')
552         }
553
554         b = strconv.AppendInt(b, int64(t.Second()), 10)
555         b = append(b, []byte{0x20}...)
556
557         tz, _ := t.Zone()
558         b = append(b, tz...)
559
560         return string(b)
561 }
562
563 // FmtTimeFull returns the full time representation of 't' for 'kea'
564 func (kea *kea) FmtTimeFull(t time.Time) string {
565
566         b := make([]byte, 0, 32)
567
568         if t.Hour() < 10 {
569                 b = append(b, '0')
570         }
571
572         b = strconv.AppendInt(b, int64(t.Hour()), 10)
573         b = append(b, kea.timeSeparator...)
574
575         if t.Minute() < 10 {
576                 b = append(b, '0')
577         }
578
579         b = strconv.AppendInt(b, int64(t.Minute()), 10)
580         b = append(b, kea.timeSeparator...)
581
582         if t.Second() < 10 {
583                 b = append(b, '0')
584         }
585
586         b = strconv.AppendInt(b, int64(t.Second()), 10)
587         b = append(b, []byte{0x20}...)
588
589         tz, _ := t.Zone()
590
591         if btz, ok := kea.timezones[tz]; ok {
592                 b = append(b, btz...)
593         } else {
594                 b = append(b, tz...)
595         }
596
597         return string(b)
598 }