OSDN Git Service

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