OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / zu_ZA / zu_ZA.go
1 package zu_ZA
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 zu_ZA 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 'zu_ZA' locale
45 func New() locales.Translator {
46         return &zu_ZA{
47                 locale:                 "zu_ZA",
48                 pluralsCardinal:        []locales.PluralRule{2, 6},
49                 pluralsOrdinal:         []locales.PluralRule{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", "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                 currencyNegativePrefix: "(",
60                 currencyNegativeSuffix: ")",
61                 monthsAbbreviated:      []string{"", "Jan", "Feb", "Mas", "Eph", "Mey", "Jun", "Jul", "Aga", "Sep", "Okt", "Nov", "Dis"},
62                 monthsNarrow:           []string{"", "J", "F", "M", "E", "M", "J", "J", "A", "S", "O", "N", "D"},
63                 monthsWide:             []string{"", "UMasingana", "Februwari", "Mashi", "Ephreli", "Meyi", "Juni", "Julayi", "Agasti", "Septhemba", "Okthoba", "Novemba", "Disemba"},
64                 daysAbbreviated:        []string{"Son", "Mso", "Bil", "Tha", "Sin", "Hla", "Mgq"},
65                 daysNarrow:             []string{"S", "M", "B", "T", "S", "H", "M"},
66                 daysShort:              []string{"Son", "Mso", "Bil", "Tha", "Sin", "Hla", "Mgq"},
67                 daysWide:               []string{"ISonto", "UMsombuluko", "ULwesibili", "ULwesithathu", "ULwesine", "ULwesihlanu", "UMgqibelo"},
68                 periodsAbbreviated:     []string{"AM", "PM"},
69                 periodsNarrow:          []string{"a", "p"},
70                 periodsWide:            []string{"AM", "PM"},
71                 erasAbbreviated:        []string{"BC", "AD"},
72                 erasNarrow:             []string{"", ""},
73                 erasWide:               []string{"BC", "AD"},
74                 timezones:              map[string]string{"AWST": "Isikhathi sase-Australian Western esivamile", "AWDT": "Isikhathi sase-Australian Western sasemini", "JST": "Isikhathi esivamile sase-Japan", "LHST": "Isikhathi sase-Lord Howe esivamile", "WARST": "Isikhathi saseNyakatho ne-Argentina sasehlobo", "AEST": "Isikhathi esivamile sase-Australian East", "CHADT": "Isikhathi sasemini sase-Chatham", "CST": "Isikhathi sase-North American Central esijwayelekile", "WAST": "Isikhathi sasehlobo saseNtshonalanga Afrika", "CLT": "Isikhathi sase-Chile esijwayelekile", "CDT": "Isikhathi sase-North American Central sasemini", "SRT": "Isikhathi sase-Suriname", "NZDT": "Isikhathi sasemini sase-New Zealand", "HNNOMX": "Isikhathi sase-Northwest Mexico esijwayelekile", "AEDT": "Isikhathi sasemini sase-Australian East", "GYT": "Isikhathi sase-Guyana", "CAT": "Isikhathi sase-Central Africa", "ChST": "Isikhathi esijwayelekile sase-Chamorro", "WIB": "Isikhathi sase-Western Indonesia", "BOT": "Isikhathi sase-Bolivia", "MST": "MST", "AST": "Isikhathi sase-Atlantic esijwayelekile", "AKDT": "Isikhathi sase-Alaska sasemini", "SGT": "Isikhathi esivamile sase-Singapore", "GMT": "Isikhathi sase-Greenwich Mean", "WITA": "Isikhathi sase-Central Indonesia", "OEZ": "Isikhathi esijwayelekile sase-Eastern Europe", "ACST": "Isikhathi sase-Australian Central esivamile", "∅∅∅": "Isikhathi sase-Amazon sasehlobo", "COST": "Isikhathi sase-Colombia sasehlobo", "HEPMX": "Isikhathi sase-Mexican Pacific sasemini", "HENOMX": "Isikhathi sase-Northwest Mexico sasemini", "VET": "Isikhathi sase-Venezuela", "HEOG": "Isikhathi sase-West Greenland sasehlobo", "HNCU": "Isikhathi sase-Cuba esijwayelekile", "HNPM": "Iikhathi sase-Saint Pierre nase-Miquelon esijwayelekile", "JDT": "Isikhathi semini sase-Japan", "IST": "Isikhathi sase-India esivamile", "SAST": "Isikhathi esijwayelekile saseNingizimu Afrika", "HKST": "Isikhathi sehlobo sase-Hong Kong", "AKST": "Isikhathi sase-Alaska esijwayelekile", "ECT": "Isikhathi sase-Ecuador", "WIT": "Isikhathi sase-Eastern Indonesia", "EDT": "Isikhathi sase-North American East sasemini", "UYST": "Isikhathi sase-Uruguay sasehlobo", "OESZ": "Isikhathi sasehlobo sase-Eastern Europe", "EAT": "Isikhathi saseMpumalanga Afrika", "ACWDT": "Isikhathi sasemini sase-Australian Central West", "ADT": "Isikhathi sase-Atlantic sasemini", "MEZ": "Isikhathi esijwayelekile sase-Central Europe", "LHDT": "Isikhathi sase-Lord Howe sasemini", "ARST": "Isikhathi sase-Argentina sasehlobo", "HEEG": "Isikhathi sase-East Greenland sasemini", "HAT": "Isikhathi sase-Newfoundland sasemini", "COT": "Isikhathi sase-Colombia esijwayelekile", "HEPM": "Isikhathi sase-Saint Pierre nase-Miquelon sasemini", "MYT": "Isikhathi sase-Malaysia", "TMT": "Isikhathi esivamile sase-Turkmenistan", "WART": "Isikhathi saseNyakatho ne-Argentina esijwayelekile", "HNEG": "Isikhathi sase-East Greenland esijwayelekile", "PDT": "Isikhathi sase-North American Pacific sasemini", "ACWST": "Isikhathi sase-Australian Central West esivamile", "BT": "Isikhathi sase-Bhutan", "MDT": "MDT", "UYT": "Isikhathi sase-Uruguay esijwayelekile", "HNOG": "Isikhathi sase-West Greenland esijwayelekile", "GFT": "Isikhathi sase-French Guiana", "WEZ": "Isikhathi esijwayelekile sase-Western Europe", "PST": "Isikhathi sase-North American Pacific esijwayelekile", "ART": "Isikhathi sase-Argentina esijwayelekile", "HKT": "Isikhathi esivamile sase-Hong Kong", "MESZ": "Isikhathi sasehlobo sase-Central Europe", "NZST": "Isikhathi esivamile sase-New Zealand", "CHAST": "Isikhathi esivamile sase-Chatham", "HADT": "Isikhathi sase-Hawaii-Aleutia sasemini", "TMST": "Isikhathi sehlobo sase-Turkmenistan", "CLST": "Isikhathi sase-Chile sasehlobo", "WESZ": "Isikhathi sasehlobo sase-Western Europe", "HNPMX": "Isikhathi sase-Mexican Pacific esijwayelekile", "HECU": "Isikhathi sase-Cuba sasemini", "HAST": "Isikhathi sase-Hawaii-Aleutia esijwayelekile", "WAT": "Isikhathi esijwayelekile saseNtshonalanga Afrika", "HNT": "Isikhathi sase-Newfoundland esijwayelekile", "EST": "Isikhathi sase-North American East esijwayelekile", "ACDT": "Isikhathi sase-Australian Central sasemini"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (zu *zu_ZA) Locale() string {
80         return zu.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'zu_ZA'
84 func (zu *zu_ZA) PluralsCardinal() []locales.PluralRule {
85         return zu.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'zu_ZA'
89 func (zu *zu_ZA) PluralsOrdinal() []locales.PluralRule {
90         return zu.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'zu_ZA'
94 func (zu *zu_ZA) PluralsRange() []locales.PluralRule {
95         return zu.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'zu_ZA'
99 func (zu *zu_ZA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102         i := int64(n)
103
104         if (i == 0) || (n == 1) {
105                 return locales.PluralRuleOne
106         }
107
108         return locales.PluralRuleOther
109 }
110
111 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'zu_ZA'
112 func (zu *zu_ZA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
113         return locales.PluralRuleOther
114 }
115
116 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'zu_ZA'
117 func (zu *zu_ZA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
118
119         start := zu.CardinalPluralRule(num1, v1)
120         end := zu.CardinalPluralRule(num2, v2)
121
122         if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
123                 return locales.PluralRuleOne
124         } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
125                 return locales.PluralRuleOther
126         }
127
128         return locales.PluralRuleOther
129
130 }
131
132 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
133 func (zu *zu_ZA) MonthAbbreviated(month time.Month) string {
134         return zu.monthsAbbreviated[month]
135 }
136
137 // MonthsAbbreviated returns the locales abbreviated months
138 func (zu *zu_ZA) MonthsAbbreviated() []string {
139         return zu.monthsAbbreviated[1:]
140 }
141
142 // MonthNarrow returns the locales narrow month given the 'month' provided
143 func (zu *zu_ZA) MonthNarrow(month time.Month) string {
144         return zu.monthsNarrow[month]
145 }
146
147 // MonthsNarrow returns the locales narrow months
148 func (zu *zu_ZA) MonthsNarrow() []string {
149         return zu.monthsNarrow[1:]
150 }
151
152 // MonthWide returns the locales wide month given the 'month' provided
153 func (zu *zu_ZA) MonthWide(month time.Month) string {
154         return zu.monthsWide[month]
155 }
156
157 // MonthsWide returns the locales wide months
158 func (zu *zu_ZA) MonthsWide() []string {
159         return zu.monthsWide[1:]
160 }
161
162 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
163 func (zu *zu_ZA) WeekdayAbbreviated(weekday time.Weekday) string {
164         return zu.daysAbbreviated[weekday]
165 }
166
167 // WeekdaysAbbreviated returns the locales abbreviated weekdays
168 func (zu *zu_ZA) WeekdaysAbbreviated() []string {
169         return zu.daysAbbreviated
170 }
171
172 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
173 func (zu *zu_ZA) WeekdayNarrow(weekday time.Weekday) string {
174         return zu.daysNarrow[weekday]
175 }
176
177 // WeekdaysNarrow returns the locales narrow weekdays
178 func (zu *zu_ZA) WeekdaysNarrow() []string {
179         return zu.daysNarrow
180 }
181
182 // WeekdayShort returns the locales short weekday given the 'weekday' provided
183 func (zu *zu_ZA) WeekdayShort(weekday time.Weekday) string {
184         return zu.daysShort[weekday]
185 }
186
187 // WeekdaysShort returns the locales short weekdays
188 func (zu *zu_ZA) WeekdaysShort() []string {
189         return zu.daysShort
190 }
191
192 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
193 func (zu *zu_ZA) WeekdayWide(weekday time.Weekday) string {
194         return zu.daysWide[weekday]
195 }
196
197 // WeekdaysWide returns the locales wide weekdays
198 func (zu *zu_ZA) WeekdaysWide() []string {
199         return zu.daysWide
200 }
201
202 // Decimal returns the decimal point of number
203 func (zu *zu_ZA) Decimal() string {
204         return zu.decimal
205 }
206
207 // Group returns the group of number
208 func (zu *zu_ZA) Group() string {
209         return zu.group
210 }
211
212 // Group returns the minus sign of number
213 func (zu *zu_ZA) Minus() string {
214         return zu.minus
215 }
216
217 // FmtNumber returns 'num' with digits/precision of 'v' for 'zu_ZA' and handles both Whole and Real numbers based on 'v'
218 func (zu *zu_ZA) FmtNumber(num float64, v uint64) string {
219
220         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
221         l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
222         count := 0
223         inWhole := v == 0
224         b := make([]byte, 0, l)
225
226         for i := len(s) - 1; i >= 0; i-- {
227
228                 if s[i] == '.' {
229                         b = append(b, zu.decimal[0])
230                         inWhole = true
231                         continue
232                 }
233
234                 if inWhole {
235                         if count == 3 {
236                                 b = append(b, zu.group[0])
237                                 count = 1
238                         } else {
239                                 count++
240                         }
241                 }
242
243                 b = append(b, s[i])
244         }
245
246         if num < 0 {
247                 b = append(b, zu.minus[0])
248         }
249
250         // reverse
251         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
252                 b[i], b[j] = b[j], b[i]
253         }
254
255         return string(b)
256 }
257
258 // FmtPercent returns 'num' with digits/precision of 'v' for 'zu_ZA' and handles both Whole and Real numbers based on 'v'
259 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
260 func (zu *zu_ZA) FmtPercent(num float64, v uint64) string {
261         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
262         l := len(s) + 3
263         b := make([]byte, 0, l)
264
265         for i := len(s) - 1; i >= 0; i-- {
266
267                 if s[i] == '.' {
268                         b = append(b, zu.decimal[0])
269                         continue
270                 }
271
272                 b = append(b, s[i])
273         }
274
275         if num < 0 {
276                 b = append(b, zu.minus[0])
277         }
278
279         // reverse
280         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
281                 b[i], b[j] = b[j], b[i]
282         }
283
284         b = append(b, zu.percent...)
285
286         return string(b)
287 }
288
289 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'zu_ZA'
290 func (zu *zu_ZA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
291
292         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
293         symbol := zu.currencies[currency]
294         l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
295         count := 0
296         inWhole := v == 0
297         b := make([]byte, 0, l)
298
299         for i := len(s) - 1; i >= 0; i-- {
300
301                 if s[i] == '.' {
302                         b = append(b, zu.decimal[0])
303                         inWhole = true
304                         continue
305                 }
306
307                 if inWhole {
308                         if count == 3 {
309                                 b = append(b, zu.group[0])
310                                 count = 1
311                         } else {
312                                 count++
313                         }
314                 }
315
316                 b = append(b, s[i])
317         }
318
319         for j := len(symbol) - 1; j >= 0; j-- {
320                 b = append(b, symbol[j])
321         }
322
323         if num < 0 {
324                 b = append(b, zu.minus[0])
325         }
326
327         // reverse
328         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
329                 b[i], b[j] = b[j], b[i]
330         }
331
332         if int(v) < 2 {
333
334                 if v == 0 {
335                         b = append(b, zu.decimal...)
336                 }
337
338                 for i := 0; i < 2-int(v); i++ {
339                         b = append(b, '0')
340                 }
341         }
342
343         return string(b)
344 }
345
346 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'zu_ZA'
347 // in accounting notation.
348 func (zu *zu_ZA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
349
350         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
351         symbol := zu.currencies[currency]
352         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
353         count := 0
354         inWhole := v == 0
355         b := make([]byte, 0, l)
356
357         for i := len(s) - 1; i >= 0; i-- {
358
359                 if s[i] == '.' {
360                         b = append(b, zu.decimal[0])
361                         inWhole = true
362                         continue
363                 }
364
365                 if inWhole {
366                         if count == 3 {
367                                 b = append(b, zu.group[0])
368                                 count = 1
369                         } else {
370                                 count++
371                         }
372                 }
373
374                 b = append(b, s[i])
375         }
376
377         if num < 0 {
378
379                 for j := len(symbol) - 1; j >= 0; j-- {
380                         b = append(b, symbol[j])
381                 }
382
383                 b = append(b, zu.currencyNegativePrefix[0])
384
385         } else {
386
387                 for j := len(symbol) - 1; j >= 0; j-- {
388                         b = append(b, symbol[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, zu.decimal...)
402                 }
403
404                 for i := 0; i < 2-int(v); i++ {
405                         b = append(b, '0')
406                 }
407         }
408
409         if num < 0 {
410                 b = append(b, zu.currencyNegativeSuffix...)
411         }
412
413         return string(b)
414 }
415
416 // FmtDateShort returns the short date representation of 't' for 'zu_ZA'
417 func (zu *zu_ZA) FmtDateShort(t time.Time) string {
418
419         b := make([]byte, 0, 32)
420
421         b = strconv.AppendInt(b, int64(t.Month()), 10)
422         b = append(b, []byte{0x2f}...)
423         b = strconv.AppendInt(b, int64(t.Day()), 10)
424         b = append(b, []byte{0x2f}...)
425
426         if t.Year() > 9 {
427                 b = append(b, strconv.Itoa(t.Year())[2:]...)
428         } else {
429                 b = append(b, strconv.Itoa(t.Year())[1:]...)
430         }
431
432         return string(b)
433 }
434
435 // FmtDateMedium returns the medium date representation of 't' for 'zu_ZA'
436 func (zu *zu_ZA) FmtDateMedium(t time.Time) string {
437
438         b := make([]byte, 0, 32)
439
440         b = append(b, zu.monthsAbbreviated[t.Month()]...)
441         b = append(b, []byte{0x20}...)
442         b = strconv.AppendInt(b, int64(t.Day()), 10)
443         b = append(b, []byte{0x2c, 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 // FmtDateLong returns the long date representation of 't' for 'zu_ZA'
455 func (zu *zu_ZA) FmtDateLong(t time.Time) string {
456
457         b := make([]byte, 0, 32)
458
459         b = append(b, zu.monthsWide[t.Month()]...)
460         b = append(b, []byte{0x20}...)
461         b = strconv.AppendInt(b, int64(t.Day()), 10)
462         b = append(b, []byte{0x2c, 0x20}...)
463
464         if t.Year() > 0 {
465                 b = strconv.AppendInt(b, int64(t.Year()), 10)
466         } else {
467                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
468         }
469
470         return string(b)
471 }
472
473 // FmtDateFull returns the full date representation of 't' for 'zu_ZA'
474 func (zu *zu_ZA) FmtDateFull(t time.Time) string {
475
476         b := make([]byte, 0, 32)
477
478         b = append(b, zu.daysWide[t.Weekday()]...)
479         b = append(b, []byte{0x2c, 0x20}...)
480         b = append(b, zu.monthsWide[t.Month()]...)
481         b = append(b, []byte{0x20}...)
482         b = strconv.AppendInt(b, int64(t.Day()), 10)
483         b = append(b, []byte{0x2c, 0x20}...)
484
485         if t.Year() > 0 {
486                 b = strconv.AppendInt(b, int64(t.Year()), 10)
487         } else {
488                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
489         }
490
491         return string(b)
492 }
493
494 // FmtTimeShort returns the short time representation of 't' for 'zu_ZA'
495 func (zu *zu_ZA) FmtTimeShort(t time.Time) string {
496
497         b := make([]byte, 0, 32)
498
499         if t.Hour() < 10 {
500                 b = append(b, '0')
501         }
502
503         b = strconv.AppendInt(b, int64(t.Hour()), 10)
504         b = append(b, zu.timeSeparator...)
505
506         if t.Minute() < 10 {
507                 b = append(b, '0')
508         }
509
510         b = strconv.AppendInt(b, int64(t.Minute()), 10)
511
512         return string(b)
513 }
514
515 // FmtTimeMedium returns the medium time representation of 't' for 'zu_ZA'
516 func (zu *zu_ZA) FmtTimeMedium(t time.Time) string {
517
518         b := make([]byte, 0, 32)
519
520         if t.Hour() < 10 {
521                 b = append(b, '0')
522         }
523
524         b = strconv.AppendInt(b, int64(t.Hour()), 10)
525         b = append(b, zu.timeSeparator...)
526
527         if t.Minute() < 10 {
528                 b = append(b, '0')
529         }
530
531         b = strconv.AppendInt(b, int64(t.Minute()), 10)
532         b = append(b, zu.timeSeparator...)
533
534         if t.Second() < 10 {
535                 b = append(b, '0')
536         }
537
538         b = strconv.AppendInt(b, int64(t.Second()), 10)
539
540         return string(b)
541 }
542
543 // FmtTimeLong returns the long time representation of 't' for 'zu_ZA'
544 func (zu *zu_ZA) FmtTimeLong(t time.Time) string {
545
546         b := make([]byte, 0, 32)
547
548         if t.Hour() < 10 {
549                 b = append(b, '0')
550         }
551
552         b = strconv.AppendInt(b, int64(t.Hour()), 10)
553         b = append(b, zu.timeSeparator...)
554
555         if t.Minute() < 10 {
556                 b = append(b, '0')
557         }
558
559         b = strconv.AppendInt(b, int64(t.Minute()), 10)
560         b = append(b, zu.timeSeparator...)
561
562         if t.Second() < 10 {
563                 b = append(b, '0')
564         }
565
566         b = strconv.AppendInt(b, int64(t.Second()), 10)
567         b = append(b, []byte{0x20}...)
568
569         tz, _ := t.Zone()
570         b = append(b, tz...)
571
572         return string(b)
573 }
574
575 // FmtTimeFull returns the full time representation of 't' for 'zu_ZA'
576 func (zu *zu_ZA) FmtTimeFull(t time.Time) string {
577
578         b := make([]byte, 0, 32)
579
580         if t.Hour() < 10 {
581                 b = append(b, '0')
582         }
583
584         b = strconv.AppendInt(b, int64(t.Hour()), 10)
585         b = append(b, zu.timeSeparator...)
586
587         if t.Minute() < 10 {
588                 b = append(b, '0')
589         }
590
591         b = strconv.AppendInt(b, int64(t.Minute()), 10)
592         b = append(b, zu.timeSeparator...)
593
594         if t.Second() < 10 {
595                 b = append(b, '0')
596         }
597
598         b = strconv.AppendInt(b, int64(t.Second()), 10)
599         b = append(b, []byte{0x20}...)
600
601         tz, _ := t.Zone()
602
603         if btz, ok := zu.timezones[tz]; ok {
604                 b = append(b, btz...)
605         } else {
606                 b = append(b, tz...)
607         }
608
609         return string(b)
610 }