OSDN Git Service

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