OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / hr_BA / hr_BA.go
1 package hr_BA
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 hr_BA 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 'hr_BA' locale
45 func New() locales.Translator {
46         return &hr_BA{
47                 locale:                 "hr_BA",
48                 pluralsCardinal:        []locales.PluralRule{2, 4, 6},
49                 pluralsOrdinal:         []locales.PluralRule{6},
50                 pluralsRange:           []locales.PluralRule{2, 4, 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", "KM", "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"},
59                 currencyPositiveSuffix: " ",
60                 currencyNegativeSuffix: " ",
61                 monthsAbbreviated:      []string{"", "sij", "velj", "ožu", "tra", "svi", "lip", "srp", "kol", "ruj", "lis", "stu", "pro"},
62                 monthsNarrow:           []string{"", "1.", "2.", "3.", "4.", "5.", "6.", "7.", "8.", "9.", "10.", "11.", "12."},
63                 monthsWide:             []string{"", "siječnja", "veljače", "ožujka", "travnja", "svibnja", "lipnja", "srpnja", "kolovoza", "rujna", "listopada", "studenoga", "prosinca"},
64                 daysAbbreviated:        []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
65                 daysNarrow:             []string{"N", "P", "U", "S", "Č", "P", "S"},
66                 daysShort:              []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
67                 daysWide:               []string{"nedjelja", "ponedjeljak", "utorak", "srijeda", "četvrtak", "petak", "subota"},
68                 periodsAbbreviated:     []string{"AM", "PM"},
69                 periodsNarrow:          []string{"AM", "PM"},
70                 periodsWide:            []string{"AM", "PM"},
71                 erasAbbreviated:        []string{"pr. Kr.", "po. Kr."},
72                 erasNarrow:             []string{"pr.n.e.", "AD"},
73                 erasWide:               []string{"prije Krista", "poslije Krista"},
74                 timezones:              map[string]string{"HENOMX": "sjeverozapadno meksičko ljetno vrijeme", "CAT": "srednjoafričko vrijeme", "HEPMX": "meksičko pacifičko ljetno vrijeme", "CST": "središnje standardno vrijeme", "VET": "venezuelsko vrijeme", "AST": "atlantsko standardno vrijeme", "EAT": "istočnoafričko vrijeme", "WAT": "zapadnoafričko standardno vrijeme", "HKT": "hongkonško standardno vrijeme", "HNPM": "standardno vrijeme za Sveti Petar i Mikelon", "HEPM": "ljetno vrijeme za Sveti Petar i Mikelon", "SRT": "surinamsko vrijeme", "BOT": "bolivijsko vrijeme", "MESZ": "srednjoeuropsko ljetno vrijeme", "AEDT": "istočnoaustralsko ljetno vrijeme", "ARST": "argentinsko ljetno vrijeme", "COT": "kolumbijsko standardno vrijeme", "AKDT": "aljaško ljetno vrijeme", "MDT": "ljetno makaosko vrijeme", "GFT": "vrijeme Francuske Gvajane", "CLST": "čileansko ljetno vrijeme", "HAST": "havajsko-aleutsko standardno vrijeme", "NZST": "novozelandsko standardno vrijeme", "NZDT": "novozelandsko ljetno vrijeme", "WARST": "zapadno-argentinsko ljetno vrijeme", "IST": "indijsko vrijeme", "ART": "argentinsko standardno vrijeme", "HNEG": "istočnogrenlandsko standardno vrijeme", "HAT": "newfoundlandsko ljetno vrijeme", "AWST": "zapadnoaustralsko standardno vrijeme", "ECT": "ekvadorsko vrijeme", "PST": "pacifičko standardno vrijeme", "BT": "butansko vrijeme", "ACDT": "srednjoaustralsko ljetno vrijeme", "MYT": "malezijsko vrijeme", "TMT": "turkmenistansko standardno vrijeme", "TMST": "turkmenistansko ljetno vrijeme", "LHST": "standardno vrijeme otoka Lord Howe", "ADT": "atlantsko ljetno vrijeme", "CLT": "čileansko standardno vrijeme", "AKST": "aljaško standardno vrijeme", "∅∅∅": "Acre ljetno vrijeme", "ACST": "srednjoaustralsko standardno vrijeme", "OESZ": "istočnoeuropsko ljetno vrijeme", "WEZ": "zapadnoeuropsko standardno vrijeme", "MEZ": "srednjoeuropsko standardno vrijeme", "HNOG": "zapadnogrenlandsko standardno vrijeme", "GMT": "univerzalno vrijeme", "HNNOMX": "sjeverozapadno meksičko standardno vrijeme", "WIT": "istočnoindonezijsko vrijeme", "JDT": "japansko ljetno vrijeme", "SAST": "južnoafričko vrijeme", "COST": "kolumbijsko ljetno vrijeme", "WESZ": "zapadnoeuropsko ljetno vrijeme", "ChST": "standardno vrijeme Chamorra", "UYST": "urugvajsko ljetno vrijeme", "WAST": "zapadnoafričko ljetno vrijeme", "HEEG": "istočnogrenlandsko ljetno vrijeme", "CHAST": "standardno vrijeme Chathama", "WITA": "srednjoindonezijsko vrijeme", "HECU": "kubansko ljetno vrijeme", "HNT": "newfoundlandsko standardno vrijeme", "WART": "zapadno-argentinsko standardno vrijeme", "ACWST": "australsko središnje zapadno standardno vrijeme", "ACWDT": "australsko središnje zapadno ljetno vrijeme", "JST": "japansko standardno vrijeme", "OEZ": "istočnoeuropsko standardno vrijeme", "LHDT": "ljetno vrijeme otoka Lord Howe", "AEST": "istočnoaustralsko standardno vrijeme", "PDT": "pacifičko ljetno vrijeme", "AWDT": "zapadnoaustralsko ljetno vrijeme", "HNCU": "kubansko standardno vrijeme", "CHADT": "ljetno vrijeme Chathama", "HADT": "havajsko-aleutsko ljetno vrijeme", "HKST": "hongkonško ljetno vrijeme", "EDT": "istočno ljetno vrijeme", "WIB": "zapadnoindonezijsko vrijeme", "MST": "standardno makaosko vrijeme", "UYT": "urugvajsko standardno vrijeme", "HEOG": "zapadnogrenlandsko ljetno vrijeme", "EST": "istočno standardno vrijeme", "GYT": "gvajansko vrijeme", "SGT": "singapursko vrijeme", "HNPMX": "meksičko pacifičko standardno vrijeme", "CDT": "središnje ljetno vrijeme"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (hr *hr_BA) Locale() string {
80         return hr.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'hr_BA'
84 func (hr *hr_BA) PluralsCardinal() []locales.PluralRule {
85         return hr.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'hr_BA'
89 func (hr *hr_BA) PluralsOrdinal() []locales.PluralRule {
90         return hr.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'hr_BA'
94 func (hr *hr_BA) PluralsRange() []locales.PluralRule {
95         return hr.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'hr_BA'
99 func (hr *hr_BA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102         i := int64(n)
103         f := locales.F(n, v)
104         iMod10 := i % 10
105         iMod100 := i % 100
106         fMod10 := f % 10
107         fMod100 := f % 100
108
109         if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
110                 return locales.PluralRuleOne
111         } else if (v == 0 && iMod10 >= 2 && iMod10 <= 4 && (iMod100 < 12 || iMod100 > 14)) || (fMod10 >= 2 && fMod10 <= 4 && (fMod100 < 12 || fMod100 > 14)) {
112                 return locales.PluralRuleFew
113         }
114
115         return locales.PluralRuleOther
116 }
117
118 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'hr_BA'
119 func (hr *hr_BA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
120         return locales.PluralRuleOther
121 }
122
123 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'hr_BA'
124 func (hr *hr_BA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
125
126         start := hr.CardinalPluralRule(num1, v1)
127         end := hr.CardinalPluralRule(num2, v2)
128
129         if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
130                 return locales.PluralRuleOne
131         } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
132                 return locales.PluralRuleFew
133         } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
134                 return locales.PluralRuleOther
135         } else if start == locales.PluralRuleFew && end == locales.PluralRuleOne {
136                 return locales.PluralRuleOne
137         } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
138                 return locales.PluralRuleFew
139         } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
140                 return locales.PluralRuleOther
141         } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
142                 return locales.PluralRuleOne
143         } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
144                 return locales.PluralRuleFew
145         }
146
147         return locales.PluralRuleOther
148
149 }
150
151 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
152 func (hr *hr_BA) MonthAbbreviated(month time.Month) string {
153         return hr.monthsAbbreviated[month]
154 }
155
156 // MonthsAbbreviated returns the locales abbreviated months
157 func (hr *hr_BA) MonthsAbbreviated() []string {
158         return hr.monthsAbbreviated[1:]
159 }
160
161 // MonthNarrow returns the locales narrow month given the 'month' provided
162 func (hr *hr_BA) MonthNarrow(month time.Month) string {
163         return hr.monthsNarrow[month]
164 }
165
166 // MonthsNarrow returns the locales narrow months
167 func (hr *hr_BA) MonthsNarrow() []string {
168         return hr.monthsNarrow[1:]
169 }
170
171 // MonthWide returns the locales wide month given the 'month' provided
172 func (hr *hr_BA) MonthWide(month time.Month) string {
173         return hr.monthsWide[month]
174 }
175
176 // MonthsWide returns the locales wide months
177 func (hr *hr_BA) MonthsWide() []string {
178         return hr.monthsWide[1:]
179 }
180
181 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
182 func (hr *hr_BA) WeekdayAbbreviated(weekday time.Weekday) string {
183         return hr.daysAbbreviated[weekday]
184 }
185
186 // WeekdaysAbbreviated returns the locales abbreviated weekdays
187 func (hr *hr_BA) WeekdaysAbbreviated() []string {
188         return hr.daysAbbreviated
189 }
190
191 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
192 func (hr *hr_BA) WeekdayNarrow(weekday time.Weekday) string {
193         return hr.daysNarrow[weekday]
194 }
195
196 // WeekdaysNarrow returns the locales narrow weekdays
197 func (hr *hr_BA) WeekdaysNarrow() []string {
198         return hr.daysNarrow
199 }
200
201 // WeekdayShort returns the locales short weekday given the 'weekday' provided
202 func (hr *hr_BA) WeekdayShort(weekday time.Weekday) string {
203         return hr.daysShort[weekday]
204 }
205
206 // WeekdaysShort returns the locales short weekdays
207 func (hr *hr_BA) WeekdaysShort() []string {
208         return hr.daysShort
209 }
210
211 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
212 func (hr *hr_BA) WeekdayWide(weekday time.Weekday) string {
213         return hr.daysWide[weekday]
214 }
215
216 // WeekdaysWide returns the locales wide weekdays
217 func (hr *hr_BA) WeekdaysWide() []string {
218         return hr.daysWide
219 }
220
221 // Decimal returns the decimal point of number
222 func (hr *hr_BA) Decimal() string {
223         return hr.decimal
224 }
225
226 // Group returns the group of number
227 func (hr *hr_BA) Group() string {
228         return hr.group
229 }
230
231 // Group returns the minus sign of number
232 func (hr *hr_BA) Minus() string {
233         return hr.minus
234 }
235
236 // FmtNumber returns 'num' with digits/precision of 'v' for 'hr_BA' and handles both Whole and Real numbers based on 'v'
237 func (hr *hr_BA) FmtNumber(num float64, v uint64) string {
238
239         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
240         l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
241         count := 0
242         inWhole := v == 0
243         b := make([]byte, 0, l)
244
245         for i := len(s) - 1; i >= 0; i-- {
246
247                 if s[i] == '.' {
248                         b = append(b, hr.decimal[0])
249                         inWhole = true
250                         continue
251                 }
252
253                 if inWhole {
254                         if count == 3 {
255                                 b = append(b, hr.group[0])
256                                 count = 1
257                         } else {
258                                 count++
259                         }
260                 }
261
262                 b = append(b, s[i])
263         }
264
265         if num < 0 {
266                 b = append(b, hr.minus[0])
267         }
268
269         // reverse
270         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
271                 b[i], b[j] = b[j], b[i]
272         }
273
274         return string(b)
275 }
276
277 // FmtPercent returns 'num' with digits/precision of 'v' for 'hr_BA' and handles both Whole and Real numbers based on 'v'
278 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
279 func (hr *hr_BA) FmtPercent(num float64, v uint64) string {
280         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
281         l := len(s) + 3
282         b := make([]byte, 0, l)
283
284         for i := len(s) - 1; i >= 0; i-- {
285
286                 if s[i] == '.' {
287                         b = append(b, hr.decimal[0])
288                         continue
289                 }
290
291                 b = append(b, s[i])
292         }
293
294         if num < 0 {
295                 b = append(b, hr.minus[0])
296         }
297
298         // reverse
299         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
300                 b[i], b[j] = b[j], b[i]
301         }
302
303         b = append(b, hr.percent...)
304
305         return string(b)
306 }
307
308 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'hr_BA'
309 func (hr *hr_BA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
310
311         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
312         symbol := hr.currencies[currency]
313         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
314         count := 0
315         inWhole := v == 0
316         b := make([]byte, 0, l)
317
318         for i := len(s) - 1; i >= 0; i-- {
319
320                 if s[i] == '.' {
321                         b = append(b, hr.decimal[0])
322                         inWhole = true
323                         continue
324                 }
325
326                 if inWhole {
327                         if count == 3 {
328                                 b = append(b, hr.group[0])
329                                 count = 1
330                         } else {
331                                 count++
332                         }
333                 }
334
335                 b = append(b, s[i])
336         }
337
338         if num < 0 {
339                 b = append(b, hr.minus[0])
340         }
341
342         // reverse
343         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
344                 b[i], b[j] = b[j], b[i]
345         }
346
347         if int(v) < 2 {
348
349                 if v == 0 {
350                         b = append(b, hr.decimal...)
351                 }
352
353                 for i := 0; i < 2-int(v); i++ {
354                         b = append(b, '0')
355                 }
356         }
357
358         b = append(b, hr.currencyPositiveSuffix...)
359
360         b = append(b, symbol...)
361
362         return string(b)
363 }
364
365 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'hr_BA'
366 // in accounting notation.
367 func (hr *hr_BA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
368
369         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
370         symbol := hr.currencies[currency]
371         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
372         count := 0
373         inWhole := v == 0
374         b := make([]byte, 0, l)
375
376         for i := len(s) - 1; i >= 0; i-- {
377
378                 if s[i] == '.' {
379                         b = append(b, hr.decimal[0])
380                         inWhole = true
381                         continue
382                 }
383
384                 if inWhole {
385                         if count == 3 {
386                                 b = append(b, hr.group[0])
387                                 count = 1
388                         } else {
389                                 count++
390                         }
391                 }
392
393                 b = append(b, s[i])
394         }
395
396         if num < 0 {
397
398                 b = append(b, hr.minus[0])
399
400         }
401
402         // reverse
403         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
404                 b[i], b[j] = b[j], b[i]
405         }
406
407         if int(v) < 2 {
408
409                 if v == 0 {
410                         b = append(b, hr.decimal...)
411                 }
412
413                 for i := 0; i < 2-int(v); i++ {
414                         b = append(b, '0')
415                 }
416         }
417
418         if num < 0 {
419                 b = append(b, hr.currencyNegativeSuffix...)
420                 b = append(b, symbol...)
421         } else {
422
423                 b = append(b, hr.currencyPositiveSuffix...)
424                 b = append(b, symbol...)
425         }
426
427         return string(b)
428 }
429
430 // FmtDateShort returns the short date representation of 't' for 'hr_BA'
431 func (hr *hr_BA) FmtDateShort(t time.Time) string {
432
433         b := make([]byte, 0, 32)
434
435         b = strconv.AppendInt(b, int64(t.Day()), 10)
436         b = append(b, []byte{0x2e, 0x20}...)
437         b = strconv.AppendInt(b, int64(t.Month()), 10)
438         b = append(b, []byte{0x2e, 0x20}...)
439
440         if t.Year() > 9 {
441                 b = append(b, strconv.Itoa(t.Year())[2:]...)
442         } else {
443                 b = append(b, strconv.Itoa(t.Year())[1:]...)
444         }
445
446         b = append(b, []byte{0x2e}...)
447
448         return string(b)
449 }
450
451 // FmtDateMedium returns the medium date representation of 't' for 'hr_BA'
452 func (hr *hr_BA) FmtDateMedium(t time.Time) string {
453
454         b := make([]byte, 0, 32)
455
456         b = strconv.AppendInt(b, int64(t.Day()), 10)
457         b = append(b, []byte{0x2e, 0x20}...)
458         b = append(b, hr.monthsAbbreviated[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         b = append(b, []byte{0x2e}...)
468
469         return string(b)
470 }
471
472 // FmtDateLong returns the long date representation of 't' for 'hr_BA'
473 func (hr *hr_BA) FmtDateLong(t time.Time) string {
474
475         b := make([]byte, 0, 32)
476
477         b = strconv.AppendInt(b, int64(t.Day()), 10)
478         b = append(b, []byte{0x2e, 0x20}...)
479         b = append(b, hr.monthsWide[t.Month()]...)
480         b = append(b, []byte{0x20}...)
481
482         if t.Year() > 0 {
483                 b = strconv.AppendInt(b, int64(t.Year()), 10)
484         } else {
485                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
486         }
487
488         b = append(b, []byte{0x2e}...)
489
490         return string(b)
491 }
492
493 // FmtDateFull returns the full date representation of 't' for 'hr_BA'
494 func (hr *hr_BA) FmtDateFull(t time.Time) string {
495
496         b := make([]byte, 0, 32)
497
498         b = append(b, hr.daysWide[t.Weekday()]...)
499         b = append(b, []byte{0x2c, 0x20}...)
500         b = strconv.AppendInt(b, int64(t.Day()), 10)
501         b = append(b, []byte{0x2e, 0x20}...)
502         b = append(b, hr.monthsWide[t.Month()]...)
503         b = append(b, []byte{0x20}...)
504
505         if t.Year() > 0 {
506                 b = strconv.AppendInt(b, int64(t.Year()), 10)
507         } else {
508                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
509         }
510
511         b = append(b, []byte{0x2e}...)
512
513         return string(b)
514 }
515
516 // FmtTimeShort returns the short time representation of 't' for 'hr_BA'
517 func (hr *hr_BA) FmtTimeShort(t time.Time) string {
518
519         b := make([]byte, 0, 32)
520
521         if t.Hour() < 10 {
522                 b = append(b, '0')
523         }
524
525         b = strconv.AppendInt(b, int64(t.Hour()), 10)
526         b = append(b, hr.timeSeparator...)
527
528         if t.Minute() < 10 {
529                 b = append(b, '0')
530         }
531
532         b = strconv.AppendInt(b, int64(t.Minute()), 10)
533
534         return string(b)
535 }
536
537 // FmtTimeMedium returns the medium time representation of 't' for 'hr_BA'
538 func (hr *hr_BA) FmtTimeMedium(t time.Time) string {
539
540         b := make([]byte, 0, 32)
541
542         if t.Hour() < 10 {
543                 b = append(b, '0')
544         }
545
546         b = strconv.AppendInt(b, int64(t.Hour()), 10)
547         b = append(b, hr.timeSeparator...)
548
549         if t.Minute() < 10 {
550                 b = append(b, '0')
551         }
552
553         b = strconv.AppendInt(b, int64(t.Minute()), 10)
554         b = append(b, hr.timeSeparator...)
555
556         if t.Second() < 10 {
557                 b = append(b, '0')
558         }
559
560         b = strconv.AppendInt(b, int64(t.Second()), 10)
561
562         return string(b)
563 }
564
565 // FmtTimeLong returns the long time representation of 't' for 'hr_BA'
566 func (hr *hr_BA) FmtTimeLong(t time.Time) string {
567
568         b := make([]byte, 0, 32)
569
570         if t.Hour() < 10 {
571                 b = append(b, '0')
572         }
573
574         b = strconv.AppendInt(b, int64(t.Hour()), 10)
575         b = append(b, hr.timeSeparator...)
576
577         if t.Minute() < 10 {
578                 b = append(b, '0')
579         }
580
581         b = strconv.AppendInt(b, int64(t.Minute()), 10)
582         b = append(b, hr.timeSeparator...)
583
584         if t.Second() < 10 {
585                 b = append(b, '0')
586         }
587
588         b = strconv.AppendInt(b, int64(t.Second()), 10)
589         b = append(b, []byte{0x20}...)
590
591         tz, _ := t.Zone()
592         b = append(b, tz...)
593
594         return string(b)
595 }
596
597 // FmtTimeFull returns the full time representation of 't' for 'hr_BA'
598 func (hr *hr_BA) FmtTimeFull(t time.Time) string {
599
600         b := make([]byte, 0, 32)
601
602         if t.Hour() < 10 {
603                 b = append(b, '0')
604         }
605
606         b = strconv.AppendInt(b, int64(t.Hour()), 10)
607         b = append(b, hr.timeSeparator...)
608
609         if t.Minute() < 10 {
610                 b = append(b, '0')
611         }
612
613         b = strconv.AppendInt(b, int64(t.Minute()), 10)
614         b = append(b, hr.timeSeparator...)
615
616         if t.Second() < 10 {
617                 b = append(b, '0')
618         }
619
620         b = strconv.AppendInt(b, int64(t.Second()), 10)
621         b = append(b, []byte{0x20, 0x28}...)
622
623         tz, _ := t.Zone()
624
625         if btz, ok := hr.timezones[tz]; ok {
626                 b = append(b, btz...)
627         } else {
628                 b = append(b, tz...)
629         }
630
631         b = append(b, []byte{0x29}...)
632
633         return string(b)
634 }