OSDN Git Service

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