OSDN Git Service

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