OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / hu / hu.go
1 package hu
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 hu 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         currencyNegativeSuffix 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 'hu' locale
45 func New() locales.Translator {
46         return &hu{
47                 locale:                 "hu",
48                 pluralsCardinal:        []locales.PluralRule{2, 6},
49                 pluralsOrdinal:         []locales.PluralRule{2, 6},
50                 pluralsRange:           []locales.PluralRule{2, 6},
51                 decimal:                ",",
52                 group:                  " ",
53                 minus:                  "-",
54                 percent:                "%",
55                 perMille:               "‰",
56                 timeSeparator:          ":",
57                 inifinity:              "∞",
58                 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", "Ft", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "¥", "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", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "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"},
59                 currencyPositiveSuffix: " ",
60                 currencyNegativeSuffix: " ",
61                 monthsAbbreviated:      []string{"", "jan.", "febr.", "márc.", "ápr.", "máj.", "jún.", "júl.", "aug.", "szept.", "okt.", "nov.", "dec."},
62                 monthsNarrow:           []string{"", "J", "F", "M", "Á", "M", "J", "J", "A", "Sz", "O", "N", "D"},
63                 monthsWide:             []string{"", "január", "február", "március", "április", "május", "június", "július", "augusztus", "szeptember", "október", "november", "december"},
64                 daysAbbreviated:        []string{"V", "H", "K", "Sze", "Cs", "P", "Szo"},
65                 daysNarrow:             []string{"V", "H", "K", "Sz", "Cs", "P", "Sz"},
66                 daysShort:              []string{"V", "H", "K", "Sze", "Cs", "P", "Szo"},
67                 daysWide:               []string{"vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"},
68                 periodsAbbreviated:     []string{"de.", "du."},
69                 periodsNarrow:          []string{"de.", "du."},
70                 periodsWide:            []string{"de.", "du."},
71                 erasAbbreviated:        []string{"i. e.", "i. sz."},
72                 erasNarrow:             []string{"ie.", "isz."},
73                 erasWide:               []string{"időszámításunk előtt", "időszámításunk szerint"},
74                 timezones:              map[string]string{"HAST": "hawaii-aleuti téli idő", "HNNOMX": "északnyugat-mexikói zónaidő", "JST": "japán téli idő", "∅∅∅": "amazóniai nyári idő", "MYT": "malajziai idő", "AWST": "nyugat-ausztráliai téli idő", "LHDT": "Lord Howe-szigeti nyári idő", "AEDT": "kelet-ausztráliai nyári idő", "HEOG": "nyugat-grönlandi nyári idő", "CHADT": "chathami nyári idő", "HNCU": "kubai téli idő", "MST": "Macaui zónaidő", "CST": "középső államokbeli zónaidő", "NZDT": "új-zélandi nyári idő", "ART": "argentínai téli idő", "ChST": "chamorrói téli idő", "HEPM": "Saint Pierre és Miquelon-i nyári idő", "CLT": "chilei téli idő", "BT": "butáni idő", "WAT": "nyugat-afrikai téli idő", "WIT": "kelet-indonéziai idő", "HAT": "új-fundlandi nyári idő", "GYT": "guyanai téli idő", "ECT": "ecuadori téli idő", "IST": "indiai téli idő", "ADT": "atlanti-óceáni nyári idő", "GFT": "francia-guianai idő", "EST": "keleti államokbeli zónaidő", "WART": "nyugat-argentínai téli idő", "UYST": "uruguayi nyári idő", "NZST": "új-zélandi téli idő", "HENOMX": "északnyugat-mexikói nyári idő", "WITA": "közép-indonéziai idő", "WIB": "nyugat-indonéziai téli idő", "UYT": "uruguayi téli idő", "ACWST": "közép-nyugat-ausztráliai téli idő", "MESZ": "közép-európai nyári idő", "AEST": "kelet-ausztráliai téli idő", "HNEG": "kelet-grönlandi téli idő", "SGT": "szingapúri téli idő", "HEPMX": "mexikói csendes-óceáni nyári idő", "OEZ": "kelet-európai téli idő", "WAST": "nyugat-afrikai nyári idő", "HKT": "hongkongi téli idő", "COST": "kolumbiai nyári idő", "EDT": "keleti államokbeli nyári idő", "CAT": "közép-afrikai téli idő", "JDT": "japán nyári idő", "ARST": "Argentínai nyári idő", "HKST": "hongkongi nyári idő", "CLST": "chilei nyári idő", "WEZ": "nyugat-európai téli idő", "HNPM": "Saint Pierre és Miquelon-i zónaidő", "SRT": "szurinámi idő", "TMT": "türkmenisztáni téli idő", "SAST": "dél-afrikai téli idő", "HEEG": "kelet-grönlandi nyári idő", "CHAST": "chathami téli idő", "MDT": "Macaui nyári idő", "HECU": "kubai nyári idő", "HNOG": "nyugat-grönlandi téli idő", "ACDT": "közép-ausztráliai nyári idő", "WESZ": "nyugat-európai nyári idő", "AWDT": "nyugat-ausztráliai nyári idő", "MEZ": "közép-európai téli idő", "AST": "atlanti-óceáni zónaidő", "ACST": "közép-ausztráliai téli idő", "AKST": "alaszkai zónaidő", "LHST": "Lord Howe-szigeti téli idő", "OESZ": "kelet-európai nyári idő", "HNT": "új-fundlandi zónaidő", "PST": "csendes-óceáni zónaidő", "PDT": "csendes-óceáni nyári idő", "ACWDT": "közép-nyugat-ausztráliai nyári idő", "WARST": "nyugat-argentínai nyári idő", "EAT": "kelet-afrikai téli idő", "AKDT": "alaszkai nyári idő", "CDT": "középső államokbeli nyári idő", "BOT": "bolíviai téli idő", "HADT": "hawaii-aleuti nyári idő", "TMST": "türkmenisztáni nyári idő", "VET": "venezuelai idő", "COT": "kolumbiai téli idő", "HNPMX": "mexikói csendes-óceáni zónaidő", "GMT": "greenwichi középidő, téli idő"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (hu *hu) Locale() string {
80         return hu.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'hu'
84 func (hu *hu) PluralsCardinal() []locales.PluralRule {
85         return hu.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'hu'
89 func (hu *hu) PluralsOrdinal() []locales.PluralRule {
90         return hu.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'hu'
94 func (hu *hu) PluralsRange() []locales.PluralRule {
95         return hu.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'hu'
99 func (hu *hu) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102
103         if n == 1 {
104                 return locales.PluralRuleOne
105         }
106
107         return locales.PluralRuleOther
108 }
109
110 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'hu'
111 func (hu *hu) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
112
113         n := math.Abs(num)
114
115         if n == 1 || n == 5 {
116                 return locales.PluralRuleOne
117         }
118
119         return locales.PluralRuleOther
120 }
121
122 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'hu'
123 func (hu *hu) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
124
125         start := hu.CardinalPluralRule(num1, v1)
126         end := hu.CardinalPluralRule(num2, v2)
127
128         if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
129                 return locales.PluralRuleOther
130         } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
131                 return locales.PluralRuleOne
132         }
133
134         return locales.PluralRuleOther
135
136 }
137
138 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
139 func (hu *hu) MonthAbbreviated(month time.Month) string {
140         return hu.monthsAbbreviated[month]
141 }
142
143 // MonthsAbbreviated returns the locales abbreviated months
144 func (hu *hu) MonthsAbbreviated() []string {
145         return hu.monthsAbbreviated[1:]
146 }
147
148 // MonthNarrow returns the locales narrow month given the 'month' provided
149 func (hu *hu) MonthNarrow(month time.Month) string {
150         return hu.monthsNarrow[month]
151 }
152
153 // MonthsNarrow returns the locales narrow months
154 func (hu *hu) MonthsNarrow() []string {
155         return hu.monthsNarrow[1:]
156 }
157
158 // MonthWide returns the locales wide month given the 'month' provided
159 func (hu *hu) MonthWide(month time.Month) string {
160         return hu.monthsWide[month]
161 }
162
163 // MonthsWide returns the locales wide months
164 func (hu *hu) MonthsWide() []string {
165         return hu.monthsWide[1:]
166 }
167
168 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
169 func (hu *hu) WeekdayAbbreviated(weekday time.Weekday) string {
170         return hu.daysAbbreviated[weekday]
171 }
172
173 // WeekdaysAbbreviated returns the locales abbreviated weekdays
174 func (hu *hu) WeekdaysAbbreviated() []string {
175         return hu.daysAbbreviated
176 }
177
178 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
179 func (hu *hu) WeekdayNarrow(weekday time.Weekday) string {
180         return hu.daysNarrow[weekday]
181 }
182
183 // WeekdaysNarrow returns the locales narrow weekdays
184 func (hu *hu) WeekdaysNarrow() []string {
185         return hu.daysNarrow
186 }
187
188 // WeekdayShort returns the locales short weekday given the 'weekday' provided
189 func (hu *hu) WeekdayShort(weekday time.Weekday) string {
190         return hu.daysShort[weekday]
191 }
192
193 // WeekdaysShort returns the locales short weekdays
194 func (hu *hu) WeekdaysShort() []string {
195         return hu.daysShort
196 }
197
198 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
199 func (hu *hu) WeekdayWide(weekday time.Weekday) string {
200         return hu.daysWide[weekday]
201 }
202
203 // WeekdaysWide returns the locales wide weekdays
204 func (hu *hu) WeekdaysWide() []string {
205         return hu.daysWide
206 }
207
208 // Decimal returns the decimal point of number
209 func (hu *hu) Decimal() string {
210         return hu.decimal
211 }
212
213 // Group returns the group of number
214 func (hu *hu) Group() string {
215         return hu.group
216 }
217
218 // Group returns the minus sign of number
219 func (hu *hu) Minus() string {
220         return hu.minus
221 }
222
223 // FmtNumber returns 'num' with digits/precision of 'v' for 'hu' and handles both Whole and Real numbers based on 'v'
224 func (hu *hu) FmtNumber(num float64, v uint64) string {
225
226         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
227         l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
228         count := 0
229         inWhole := v == 0
230         b := make([]byte, 0, l)
231
232         for i := len(s) - 1; i >= 0; i-- {
233
234                 if s[i] == '.' {
235                         b = append(b, hu.decimal[0])
236                         inWhole = true
237                         continue
238                 }
239
240                 if inWhole {
241                         if count == 3 {
242                                 for j := len(hu.group) - 1; j >= 0; j-- {
243                                         b = append(b, hu.group[j])
244                                 }
245                                 count = 1
246                         } else {
247                                 count++
248                         }
249                 }
250
251                 b = append(b, s[i])
252         }
253
254         if num < 0 {
255                 b = append(b, hu.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         return string(b)
264 }
265
266 // FmtPercent returns 'num' with digits/precision of 'v' for 'hu' and handles both Whole and Real numbers based on 'v'
267 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
268 func (hu *hu) FmtPercent(num float64, v uint64) string {
269         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
270         l := len(s) + 3
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, hu.decimal[0])
277                         continue
278                 }
279
280                 b = append(b, s[i])
281         }
282
283         if num < 0 {
284                 b = append(b, hu.minus[0])
285         }
286
287         // reverse
288         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
289                 b[i], b[j] = b[j], b[i]
290         }
291
292         b = append(b, hu.percent...)
293
294         return string(b)
295 }
296
297 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'hu'
298 func (hu *hu) FmtCurrency(num float64, v uint64, currency currency.Type) string {
299
300         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
301         symbol := hu.currencies[currency]
302         l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
303         count := 0
304         inWhole := v == 0
305         b := make([]byte, 0, l)
306
307         for i := len(s) - 1; i >= 0; i-- {
308
309                 if s[i] == '.' {
310                         b = append(b, hu.decimal[0])
311                         inWhole = true
312                         continue
313                 }
314
315                 if inWhole {
316                         if count == 3 {
317                                 for j := len(hu.group) - 1; j >= 0; j-- {
318                                         b = append(b, hu.group[j])
319                                 }
320                                 count = 1
321                         } else {
322                                 count++
323                         }
324                 }
325
326                 b = append(b, s[i])
327         }
328
329         if num < 0 {
330                 b = append(b, hu.minus[0])
331         }
332
333         // reverse
334         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
335                 b[i], b[j] = b[j], b[i]
336         }
337
338         if int(v) < 2 {
339
340                 if v == 0 {
341                         b = append(b, hu.decimal...)
342                 }
343
344                 for i := 0; i < 2-int(v); i++ {
345                         b = append(b, '0')
346                 }
347         }
348
349         b = append(b, hu.currencyPositiveSuffix...)
350
351         b = append(b, symbol...)
352
353         return string(b)
354 }
355
356 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'hu'
357 // in accounting notation.
358 func (hu *hu) FmtAccounting(num float64, v uint64, currency currency.Type) string {
359
360         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
361         symbol := hu.currencies[currency]
362         l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
363         count := 0
364         inWhole := v == 0
365         b := make([]byte, 0, l)
366
367         for i := len(s) - 1; i >= 0; i-- {
368
369                 if s[i] == '.' {
370                         b = append(b, hu.decimal[0])
371                         inWhole = true
372                         continue
373                 }
374
375                 if inWhole {
376                         if count == 3 {
377                                 for j := len(hu.group) - 1; j >= 0; j-- {
378                                         b = append(b, hu.group[j])
379                                 }
380                                 count = 1
381                         } else {
382                                 count++
383                         }
384                 }
385
386                 b = append(b, s[i])
387         }
388
389         if num < 0 {
390
391                 b = append(b, hu.minus[0])
392
393         }
394
395         // reverse
396         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
397                 b[i], b[j] = b[j], b[i]
398         }
399
400         if int(v) < 2 {
401
402                 if v == 0 {
403                         b = append(b, hu.decimal...)
404                 }
405
406                 for i := 0; i < 2-int(v); i++ {
407                         b = append(b, '0')
408                 }
409         }
410
411         if num < 0 {
412                 b = append(b, hu.currencyNegativeSuffix...)
413                 b = append(b, symbol...)
414         } else {
415
416                 b = append(b, hu.currencyPositiveSuffix...)
417                 b = append(b, symbol...)
418         }
419
420         return string(b)
421 }
422
423 // FmtDateShort returns the short date representation of 't' for 'hu'
424 func (hu *hu) FmtDateShort(t time.Time) string {
425
426         b := make([]byte, 0, 32)
427
428         if t.Year() > 0 {
429                 b = strconv.AppendInt(b, int64(t.Year()), 10)
430         } else {
431                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
432         }
433
434         b = append(b, []byte{0x2e, 0x20}...)
435
436         if t.Month() < 10 {
437                 b = append(b, '0')
438         }
439
440         b = strconv.AppendInt(b, int64(t.Month()), 10)
441
442         b = append(b, []byte{0x2e, 0x20}...)
443
444         if t.Day() < 10 {
445                 b = append(b, '0')
446         }
447
448         b = strconv.AppendInt(b, int64(t.Day()), 10)
449         b = append(b, []byte{0x2e}...)
450
451         return string(b)
452 }
453
454 // FmtDateMedium returns the medium date representation of 't' for 'hu'
455 func (hu *hu) FmtDateMedium(t time.Time) string {
456
457         b := make([]byte, 0, 32)
458
459         if t.Year() > 0 {
460                 b = strconv.AppendInt(b, int64(t.Year()), 10)
461         } else {
462                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
463         }
464
465         b = append(b, []byte{0x2e, 0x20}...)
466         b = append(b, hu.monthsAbbreviated[t.Month()]...)
467         b = append(b, []byte{0x20}...)
468         b = strconv.AppendInt(b, int64(t.Day()), 10)
469         b = append(b, []byte{0x2e}...)
470
471         return string(b)
472 }
473
474 // FmtDateLong returns the long date representation of 't' for 'hu'
475 func (hu *hu) FmtDateLong(t time.Time) string {
476
477         b := make([]byte, 0, 32)
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         b = append(b, []byte{0x2e, 0x20}...)
486         b = append(b, hu.monthsWide[t.Month()]...)
487         b = append(b, []byte{0x20}...)
488         b = strconv.AppendInt(b, int64(t.Day()), 10)
489         b = append(b, []byte{0x2e}...)
490
491         return string(b)
492 }
493
494 // FmtDateFull returns the full date representation of 't' for 'hu'
495 func (hu *hu) FmtDateFull(t time.Time) string {
496
497         b := make([]byte, 0, 32)
498
499         if t.Year() > 0 {
500                 b = strconv.AppendInt(b, int64(t.Year()), 10)
501         } else {
502                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
503         }
504
505         b = append(b, []byte{0x2e, 0x20}...)
506         b = append(b, hu.monthsWide[t.Month()]...)
507         b = append(b, []byte{0x20}...)
508         b = strconv.AppendInt(b, int64(t.Day()), 10)
509         b = append(b, []byte{0x2e, 0x2c, 0x20}...)
510         b = append(b, hu.daysWide[t.Weekday()]...)
511
512         return string(b)
513 }
514
515 // FmtTimeShort returns the short time representation of 't' for 'hu'
516 func (hu *hu) FmtTimeShort(t time.Time) string {
517
518         b := make([]byte, 0, 32)
519
520         b = strconv.AppendInt(b, int64(t.Hour()), 10)
521         b = append(b, hu.timeSeparator...)
522
523         if t.Minute() < 10 {
524                 b = append(b, '0')
525         }
526
527         b = strconv.AppendInt(b, int64(t.Minute()), 10)
528
529         return string(b)
530 }
531
532 // FmtTimeMedium returns the medium time representation of 't' for 'hu'
533 func (hu *hu) FmtTimeMedium(t time.Time) string {
534
535         b := make([]byte, 0, 32)
536
537         b = strconv.AppendInt(b, int64(t.Hour()), 10)
538         b = append(b, hu.timeSeparator...)
539
540         if t.Minute() < 10 {
541                 b = append(b, '0')
542         }
543
544         b = strconv.AppendInt(b, int64(t.Minute()), 10)
545         b = append(b, hu.timeSeparator...)
546
547         if t.Second() < 10 {
548                 b = append(b, '0')
549         }
550
551         b = strconv.AppendInt(b, int64(t.Second()), 10)
552
553         return string(b)
554 }
555
556 // FmtTimeLong returns the long time representation of 't' for 'hu'
557 func (hu *hu) FmtTimeLong(t time.Time) string {
558
559         b := make([]byte, 0, 32)
560
561         b = strconv.AppendInt(b, int64(t.Hour()), 10)
562         b = append(b, hu.timeSeparator...)
563
564         if t.Minute() < 10 {
565                 b = append(b, '0')
566         }
567
568         b = strconv.AppendInt(b, int64(t.Minute()), 10)
569         b = append(b, hu.timeSeparator...)
570
571         if t.Second() < 10 {
572                 b = append(b, '0')
573         }
574
575         b = strconv.AppendInt(b, int64(t.Second()), 10)
576         b = append(b, []byte{0x20}...)
577
578         tz, _ := t.Zone()
579         b = append(b, tz...)
580
581         return string(b)
582 }
583
584 // FmtTimeFull returns the full time representation of 't' for 'hu'
585 func (hu *hu) FmtTimeFull(t time.Time) string {
586
587         b := make([]byte, 0, 32)
588
589         b = strconv.AppendInt(b, int64(t.Hour()), 10)
590         b = append(b, hu.timeSeparator...)
591
592         if t.Minute() < 10 {
593                 b = append(b, '0')
594         }
595
596         b = strconv.AppendInt(b, int64(t.Minute()), 10)
597         b = append(b, hu.timeSeparator...)
598
599         if t.Second() < 10 {
600                 b = append(b, '0')
601         }
602
603         b = strconv.AppendInt(b, int64(t.Second()), 10)
604         b = append(b, []byte{0x20}...)
605
606         tz, _ := t.Zone()
607
608         if btz, ok := hu.timezones[tz]; ok {
609                 b = append(b, btz...)
610         } else {
611                 b = append(b, tz...)
612         }
613
614         return string(b)
615 }