OSDN Git Service

delete miner
[bytom/vapor.git] / vendor / github.com / go-playground / locales / ka / ka.go
1 package ka
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 ka 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         percentSuffix          string
22         perMille               string
23         timeSeparator          string
24         inifinity              string
25         currencies             []string // idx = enum of currency code
26         currencyPositiveSuffix string
27         currencyNegativeSuffix string
28         monthsAbbreviated      []string
29         monthsNarrow           []string
30         monthsWide             []string
31         daysAbbreviated        []string
32         daysNarrow             []string
33         daysShort              []string
34         daysWide               []string
35         periodsAbbreviated     []string
36         periodsNarrow          []string
37         periodsShort           []string
38         periodsWide            []string
39         erasAbbreviated        []string
40         erasNarrow             []string
41         erasWide               []string
42         timezones              map[string]string
43 }
44
45 // New returns a new instance of translator for the 'ka' locale
46 func New() locales.Translator {
47         return &ka{
48                 locale:                 "ka",
49                 pluralsCardinal:        []locales.PluralRule{2, 6},
50                 pluralsOrdinal:         []locales.PluralRule{2, 5, 6},
51                 pluralsRange:           []locales.PluralRule{2, 6},
52                 decimal:                ",",
53                 group:                  " ",
54                 minus:                  "-",
55                 percent:                "%",
56                 perMille:               "‰",
57                 timeSeparator:          ":",
58                 inifinity:              "∞",
59                 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", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "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", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "₾", "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", "MX$", "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", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
60                 percentSuffix:          " ",
61                 currencyPositiveSuffix: " ",
62                 currencyNegativeSuffix: " ",
63                 monthsAbbreviated:      []string{"", "იან", "თებ", "მარ", "აპრ", "მაი", "ივნ", "ივლ", "აგვ", "სექ", "ოქტ", "ნოე", "დეკ"},
64                 monthsNarrow:           []string{"", "ი", "თ", "მ", "ა", "მ", "ი", "ი", "ა", "ს", "ო", "ნ", "დ"},
65                 monthsWide:             []string{"", "იანვარი", "თებერვალი", "მარტი", "აპრილი", "მაისი", "ივნისი", "ივლისი", "აგვისტო", "სექტემბერი", "ოქტომბერი", "ნოემბერი", "დეკემბერი"},
66                 daysAbbreviated:        []string{"კვი", "ორშ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ"},
67                 daysNarrow:             []string{"კ", "ო", "ს", "ო", "ხ", "პ", "შ"},
68                 daysShort:              []string{"კვ", "ორ", "სმ", "ოთ", "ხთ", "პრ", "შბ"},
69                 daysWide:               []string{"კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი"},
70                 periodsAbbreviated:     []string{"AM", "PM"},
71                 periodsNarrow:          []string{"a", "p"},
72                 periodsWide:            []string{"AM", "PM"},
73                 erasAbbreviated:        []string{"ძვ. წ.", "ახ. წ."},
74                 erasNarrow:             []string{"", ""},
75                 erasWide:               []string{"ძველი წელთაღრიცხვით", "ახალი წელთაღრიცხვით"},
76                 timezones:              map[string]string{"HNNOMX": "ჩრდილო-დასავლეთ მექსიკის დრო", "ART": "არგენტინის სტანდარტული დრო", "UYT": "ურუგვაის სტანდარტული დრო", "OEZ": "აღმოსავლეთ ევროპის სტანდარტული დრო", "VET": "ვენესუელის დრო", "HNT": "ნიუფაუნდლენდის სტანდარტული დრო", "AKST": "ალასკის სტანდარტული დრო", "AWDT": "დასავლეთ ავსტრალიის ზაფხულის დრო", "MESZ": "ცენტრალური ევროპის ზაფხულის დრო", "IST": "ინდოეთის დრო", "ADT": "ატლანტიკის ოკეანის ზაფხულის დრო", "HKST": "ჰონკონგის ზაფხულის დრო", "GYT": "გაიანის დრო", "GMT": "გრინვიჩის საშუალო დრო", "HNPMX": "მექსიკის წყნარი ოკეანის სტანდარტული დრო", "WIT": "აღმოსავლეთ ინდონეზიის დრო", "WITA": "ცენტრალური ინდონეზიის დრო", "JST": "იაპონიის სტანდარტული დრო", "BT": "ბუტანის დრო", "EDT": "ჩრდილოეთ ამერიკის აღმოსავლეთის ზაფხულის დრო", "ChST": "ჩამოროს დრო", "HEPMX": "მექსიკის წყნარი ოკეანის ზაფხულის დრო", "CHADT": "ჩატემის ზაფხულის დრო", "HEPM": "სენ-პიერის და მიკელონის ზაფხულის დრო", "MST": "MST", "LHDT": "ლორდ-ჰაუს ზაფხულის დრო", "HAT": "ნიუფაუნდლენდის ზაფხულის დრო", "JDT": "იაპონიის ზაფხულის დრო", "ARST": "არგენტინის ზაფხულის დრო", "BOT": "ბოლივიის დრო", "WAT": "დასავლეთ აფრიკის სტანდარტული დრო", "SGT": "სინგაპურის დრო", "HECU": "კუბის ზაფხულის დრო", "CDT": "ჩრდილოეთ ამერიკის ცენტრალური ზაფხულის დრო", "ACWDT": "ცენტრალური და დასავლეთ ავსტრალიის ზაფხულის დრო", "HAST": "ჰავაისა და ალეუტის სტანდარტული დრო", "WARST": "დასავლეთ არგენტინის ზაფხულის დრო", "WEZ": "დასავლეთ ევროპის სტანდარტული დრო", "PST": "ჩრდილოეთ ამერიკის წყნარი ოკეანის სტანდარტული დრო", "HNPM": "სენ-პიერის და მიკელონის სტანდარტული დრო", "MYT": "მალაიზიის დრო", "NZDT": "ახალი ზელანდიის ზაფხულის დრო", "LHST": "ლორდ-ჰაუს სტანდარტული დრო", "HNEG": "აღმოსავლეთ გრენლანდიის სტანდარტული დრო", "HKT": "ჰონკონგის სტანდარტული დრო", "EST": "ჩრდილოეთ ამერიკის აღმოსავლეთის სტანდარტული დრო", "AWST": "დასავლეთ ავსტრალიის სტანდარტული დრო", "UYST": "ურუგვაის ზაფხულის დრო", "HNOG": "დასავლეთ გრენლანდიის სტანდარტული დრო", "ACWST": "ცენტრალური და დასავლეთ ავსტრალიის სტანდარტული დრო", "EAT": "აღმოსავლეთ აფრიკის დრო", "CLST": "ჩილეს ზაფხულის დრო", "CLT": "ჩილეს სტანდარტული დრო", "ACST": "ავსტრალიის ცენტრალური სტანდარტული დრო", "HENOMX": "ჩრდილო-დასავლეთ მექსიკის ზაფხულის დრო", "WAST": "დასავლეთ აფრიკის ზაფხულის დრო", "HEEG": "აღმოსავლეთ გრენლანდიის ზაფხულის დრო", "OESZ": "აღმოსავლეთ ევროპის ზაფხულის დრო", "WART": "დასავლეთ არგენტინის სტანდარტული დრო", "AST": "ატლანტიკის ოკეანის სტანდარტული დრო", "AEST": "აღმოსავლეთ ავსტრალიის სტანდარტული დრო", "HEOG": "დასავლეთ გრენლანდიის ზაფხულის დრო", "CST": "ჩრდილოეთ ამერიკის ცენტრალური სტანდარტული დრო", "MDT": "MDT", "SRT": "სურინამის დრო", "HNCU": "კუბის სტანდარტული დრო", "GFT": "საფრანგეთის გვიანის დრო", "ACDT": "ავსტრალიის ცენტრალური ზაფხულის დრო", "CHAST": "ჩატემის სტანდარტული დრო", "SAST": "სამხრეთ აფრიკის დრო", "COST": "კოლუმბიის ზაფხულის დრო", "ECT": "ეკვადორის დრო", "HADT": "ჰავაისა და ალეუტის ზაფხულის დრო", "NZST": "ახალი ზელანდიის სტანდარტული დრო", "TMT": "თურქმენეთის სტანდარტული დრო", "PDT": "ჩრდილოეთ ამერიკის წყნარი ოკეანის ზაფხულის დრო", "COT": "კოლუმბიის სტანდარტული დრო", "AKDT": "ალასკის ზაფხულის დრო", "CAT": "ცენტრალური აფრიკის დრო", "WESZ": "დასავლეთ ევროპის ზაფხულის დრო", "∅∅∅": "∅∅∅", "MEZ": "ცენტრალური ევროპის სტანდარტული დრო", "AEDT": "აღმოსავლეთ ავსტრალიის ზაფხულის დრო", "TMST": "თურქმენეთის ზაფხულის დრო", "WIB": "დასავლეთ ინდონეზიის დრო"},
77         }
78 }
79
80 // Locale returns the current translators string locale
81 func (ka *ka) Locale() string {
82         return ka.locale
83 }
84
85 // PluralsCardinal returns the list of cardinal plural rules associated with 'ka'
86 func (ka *ka) PluralsCardinal() []locales.PluralRule {
87         return ka.pluralsCardinal
88 }
89
90 // PluralsOrdinal returns the list of ordinal plural rules associated with 'ka'
91 func (ka *ka) PluralsOrdinal() []locales.PluralRule {
92         return ka.pluralsOrdinal
93 }
94
95 // PluralsRange returns the list of range plural rules associated with 'ka'
96 func (ka *ka) PluralsRange() []locales.PluralRule {
97         return ka.pluralsRange
98 }
99
100 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ka'
101 func (ka *ka) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
102
103         n := math.Abs(num)
104
105         if n == 1 {
106                 return locales.PluralRuleOne
107         }
108
109         return locales.PluralRuleOther
110 }
111
112 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ka'
113 func (ka *ka) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
114
115         n := math.Abs(num)
116         i := int64(n)
117         iMod100 := i % 100
118
119         if i == 1 {
120                 return locales.PluralRuleOne
121         } else if (i == 0) || (iMod100 >= 2 && iMod100 <= 20 && (iMod100 == 40 || iMod100 == 60 || iMod100 == 80)) {
122                 return locales.PluralRuleMany
123         }
124
125         return locales.PluralRuleOther
126 }
127
128 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ka'
129 func (ka *ka) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
130
131         start := ka.CardinalPluralRule(num1, v1)
132         end := ka.CardinalPluralRule(num2, v2)
133
134         if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
135                 return locales.PluralRuleOne
136         } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
137                 return locales.PluralRuleOther
138         }
139
140         return locales.PluralRuleOther
141
142 }
143
144 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
145 func (ka *ka) MonthAbbreviated(month time.Month) string {
146         return ka.monthsAbbreviated[month]
147 }
148
149 // MonthsAbbreviated returns the locales abbreviated months
150 func (ka *ka) MonthsAbbreviated() []string {
151         return ka.monthsAbbreviated[1:]
152 }
153
154 // MonthNarrow returns the locales narrow month given the 'month' provided
155 func (ka *ka) MonthNarrow(month time.Month) string {
156         return ka.monthsNarrow[month]
157 }
158
159 // MonthsNarrow returns the locales narrow months
160 func (ka *ka) MonthsNarrow() []string {
161         return ka.monthsNarrow[1:]
162 }
163
164 // MonthWide returns the locales wide month given the 'month' provided
165 func (ka *ka) MonthWide(month time.Month) string {
166         return ka.monthsWide[month]
167 }
168
169 // MonthsWide returns the locales wide months
170 func (ka *ka) MonthsWide() []string {
171         return ka.monthsWide[1:]
172 }
173
174 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
175 func (ka *ka) WeekdayAbbreviated(weekday time.Weekday) string {
176         return ka.daysAbbreviated[weekday]
177 }
178
179 // WeekdaysAbbreviated returns the locales abbreviated weekdays
180 func (ka *ka) WeekdaysAbbreviated() []string {
181         return ka.daysAbbreviated
182 }
183
184 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
185 func (ka *ka) WeekdayNarrow(weekday time.Weekday) string {
186         return ka.daysNarrow[weekday]
187 }
188
189 // WeekdaysNarrow returns the locales narrow weekdays
190 func (ka *ka) WeekdaysNarrow() []string {
191         return ka.daysNarrow
192 }
193
194 // WeekdayShort returns the locales short weekday given the 'weekday' provided
195 func (ka *ka) WeekdayShort(weekday time.Weekday) string {
196         return ka.daysShort[weekday]
197 }
198
199 // WeekdaysShort returns the locales short weekdays
200 func (ka *ka) WeekdaysShort() []string {
201         return ka.daysShort
202 }
203
204 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
205 func (ka *ka) WeekdayWide(weekday time.Weekday) string {
206         return ka.daysWide[weekday]
207 }
208
209 // WeekdaysWide returns the locales wide weekdays
210 func (ka *ka) WeekdaysWide() []string {
211         return ka.daysWide
212 }
213
214 // Decimal returns the decimal point of number
215 func (ka *ka) Decimal() string {
216         return ka.decimal
217 }
218
219 // Group returns the group of number
220 func (ka *ka) Group() string {
221         return ka.group
222 }
223
224 // Group returns the minus sign of number
225 func (ka *ka) Minus() string {
226         return ka.minus
227 }
228
229 // FmtNumber returns 'num' with digits/precision of 'v' for 'ka' and handles both Whole and Real numbers based on 'v'
230 func (ka *ka) FmtNumber(num float64, v uint64) string {
231
232         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
233         l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
234         count := 0
235         inWhole := v == 0
236         b := make([]byte, 0, l)
237
238         for i := len(s) - 1; i >= 0; i-- {
239
240                 if s[i] == '.' {
241                         b = append(b, ka.decimal[0])
242                         inWhole = true
243                         continue
244                 }
245
246                 if inWhole {
247                         if count == 3 {
248                                 for j := len(ka.group) - 1; j >= 0; j-- {
249                                         b = append(b, ka.group[j])
250                                 }
251                                 count = 1
252                         } else {
253                                 count++
254                         }
255                 }
256
257                 b = append(b, s[i])
258         }
259
260         if num < 0 {
261                 b = append(b, ka.minus[0])
262         }
263
264         // reverse
265         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
266                 b[i], b[j] = b[j], b[i]
267         }
268
269         return string(b)
270 }
271
272 // FmtPercent returns 'num' with digits/precision of 'v' for 'ka' and handles both Whole and Real numbers based on 'v'
273 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
274 func (ka *ka) FmtPercent(num float64, v uint64) string {
275         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
276         l := len(s) + 5
277         b := make([]byte, 0, l)
278
279         for i := len(s) - 1; i >= 0; i-- {
280
281                 if s[i] == '.' {
282                         b = append(b, ka.decimal[0])
283                         continue
284                 }
285
286                 b = append(b, s[i])
287         }
288
289         if num < 0 {
290                 b = append(b, ka.minus[0])
291         }
292
293         // reverse
294         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
295                 b[i], b[j] = b[j], b[i]
296         }
297
298         b = append(b, ka.percentSuffix...)
299
300         b = append(b, ka.percent...)
301
302         return string(b)
303 }
304
305 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ka'
306 func (ka *ka) FmtCurrency(num float64, v uint64, currency currency.Type) string {
307
308         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
309         symbol := ka.currencies[currency]
310         l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
311         count := 0
312         inWhole := v == 0
313         b := make([]byte, 0, l)
314
315         for i := len(s) - 1; i >= 0; i-- {
316
317                 if s[i] == '.' {
318                         b = append(b, ka.decimal[0])
319                         inWhole = true
320                         continue
321                 }
322
323                 if inWhole {
324                         if count == 3 {
325                                 for j := len(ka.group) - 1; j >= 0; j-- {
326                                         b = append(b, ka.group[j])
327                                 }
328                                 count = 1
329                         } else {
330                                 count++
331                         }
332                 }
333
334                 b = append(b, s[i])
335         }
336
337         if num < 0 {
338                 b = append(b, ka.minus[0])
339         }
340
341         // reverse
342         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
343                 b[i], b[j] = b[j], b[i]
344         }
345
346         if int(v) < 2 {
347
348                 if v == 0 {
349                         b = append(b, ka.decimal...)
350                 }
351
352                 for i := 0; i < 2-int(v); i++ {
353                         b = append(b, '0')
354                 }
355         }
356
357         b = append(b, ka.currencyPositiveSuffix...)
358
359         b = append(b, symbol...)
360
361         return string(b)
362 }
363
364 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ka'
365 // in accounting notation.
366 func (ka *ka) FmtAccounting(num float64, v uint64, currency currency.Type) string {
367
368         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
369         symbol := ka.currencies[currency]
370         l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
371         count := 0
372         inWhole := v == 0
373         b := make([]byte, 0, l)
374
375         for i := len(s) - 1; i >= 0; i-- {
376
377                 if s[i] == '.' {
378                         b = append(b, ka.decimal[0])
379                         inWhole = true
380                         continue
381                 }
382
383                 if inWhole {
384                         if count == 3 {
385                                 for j := len(ka.group) - 1; j >= 0; j-- {
386                                         b = append(b, ka.group[j])
387                                 }
388                                 count = 1
389                         } else {
390                                 count++
391                         }
392                 }
393
394                 b = append(b, s[i])
395         }
396
397         if num < 0 {
398
399                 b = append(b, ka.minus[0])
400
401         }
402
403         // reverse
404         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
405                 b[i], b[j] = b[j], b[i]
406         }
407
408         if int(v) < 2 {
409
410                 if v == 0 {
411                         b = append(b, ka.decimal...)
412                 }
413
414                 for i := 0; i < 2-int(v); i++ {
415                         b = append(b, '0')
416                 }
417         }
418
419         if num < 0 {
420                 b = append(b, ka.currencyNegativeSuffix...)
421                 b = append(b, symbol...)
422         } else {
423
424                 b = append(b, ka.currencyPositiveSuffix...)
425                 b = append(b, symbol...)
426         }
427
428         return string(b)
429 }
430
431 // FmtDateShort returns the short date representation of 't' for 'ka'
432 func (ka *ka) FmtDateShort(t time.Time) string {
433
434         b := make([]byte, 0, 32)
435
436         if t.Day() < 10 {
437                 b = append(b, '0')
438         }
439
440         b = strconv.AppendInt(b, int64(t.Day()), 10)
441         b = append(b, []byte{0x2e}...)
442
443         if t.Month() < 10 {
444                 b = append(b, '0')
445         }
446
447         b = strconv.AppendInt(b, int64(t.Month()), 10)
448
449         b = append(b, []byte{0x2e}...)
450
451         if t.Year() > 9 {
452                 b = append(b, strconv.Itoa(t.Year())[2:]...)
453         } else {
454                 b = append(b, strconv.Itoa(t.Year())[1:]...)
455         }
456
457         return string(b)
458 }
459
460 // FmtDateMedium returns the medium date representation of 't' for 'ka'
461 func (ka *ka) FmtDateMedium(t time.Time) string {
462
463         b := make([]byte, 0, 32)
464
465         b = strconv.AppendInt(b, int64(t.Day()), 10)
466         b = append(b, []byte{0x20}...)
467         b = append(b, ka.monthsAbbreviated[t.Month()]...)
468         b = append(b, []byte{0x2e, 0x20}...)
469
470         if t.Year() > 0 {
471                 b = strconv.AppendInt(b, int64(t.Year()), 10)
472         } else {
473                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
474         }
475
476         return string(b)
477 }
478
479 // FmtDateLong returns the long date representation of 't' for 'ka'
480 func (ka *ka) FmtDateLong(t time.Time) string {
481
482         b := make([]byte, 0, 32)
483
484         b = strconv.AppendInt(b, int64(t.Day()), 10)
485         b = append(b, []byte{0x20}...)
486         b = append(b, ka.monthsWide[t.Month()]...)
487         b = append(b, []byte{0x2c, 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 // FmtDateFull returns the full date representation of 't' for 'ka'
499 func (ka *ka) FmtDateFull(t time.Time) string {
500
501         b := make([]byte, 0, 32)
502
503         b = append(b, ka.daysWide[t.Weekday()]...)
504         b = append(b, []byte{0x2c, 0x20}...)
505
506         if t.Day() < 10 {
507                 b = append(b, '0')
508         }
509
510         b = strconv.AppendInt(b, int64(t.Day()), 10)
511         b = append(b, []byte{0x20}...)
512         b = append(b, ka.monthsWide[t.Month()]...)
513         b = append(b, []byte{0x2c, 0x20}...)
514
515         if t.Year() > 0 {
516                 b = strconv.AppendInt(b, int64(t.Year()), 10)
517         } else {
518                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
519         }
520
521         return string(b)
522 }
523
524 // FmtTimeShort returns the short time representation of 't' for 'ka'
525 func (ka *ka) FmtTimeShort(t time.Time) string {
526
527         b := make([]byte, 0, 32)
528
529         if t.Hour() < 10 {
530                 b = append(b, '0')
531         }
532
533         b = strconv.AppendInt(b, int64(t.Hour()), 10)
534         b = append(b, ka.timeSeparator...)
535
536         if t.Minute() < 10 {
537                 b = append(b, '0')
538         }
539
540         b = strconv.AppendInt(b, int64(t.Minute()), 10)
541
542         return string(b)
543 }
544
545 // FmtTimeMedium returns the medium time representation of 't' for 'ka'
546 func (ka *ka) FmtTimeMedium(t time.Time) string {
547
548         b := make([]byte, 0, 32)
549
550         if t.Hour() < 10 {
551                 b = append(b, '0')
552         }
553
554         b = strconv.AppendInt(b, int64(t.Hour()), 10)
555         b = append(b, ka.timeSeparator...)
556
557         if t.Minute() < 10 {
558                 b = append(b, '0')
559         }
560
561         b = strconv.AppendInt(b, int64(t.Minute()), 10)
562         b = append(b, ka.timeSeparator...)
563
564         if t.Second() < 10 {
565                 b = append(b, '0')
566         }
567
568         b = strconv.AppendInt(b, int64(t.Second()), 10)
569
570         return string(b)
571 }
572
573 // FmtTimeLong returns the long time representation of 't' for 'ka'
574 func (ka *ka) FmtTimeLong(t time.Time) string {
575
576         b := make([]byte, 0, 32)
577
578         if t.Hour() < 10 {
579                 b = append(b, '0')
580         }
581
582         b = strconv.AppendInt(b, int64(t.Hour()), 10)
583         b = append(b, ka.timeSeparator...)
584
585         if t.Minute() < 10 {
586                 b = append(b, '0')
587         }
588
589         b = strconv.AppendInt(b, int64(t.Minute()), 10)
590         b = append(b, ka.timeSeparator...)
591
592         if t.Second() < 10 {
593                 b = append(b, '0')
594         }
595
596         b = strconv.AppendInt(b, int64(t.Second()), 10)
597         b = append(b, []byte{0x20}...)
598
599         tz, _ := t.Zone()
600         b = append(b, tz...)
601
602         return string(b)
603 }
604
605 // FmtTimeFull returns the full time representation of 't' for 'ka'
606 func (ka *ka) FmtTimeFull(t time.Time) string {
607
608         b := make([]byte, 0, 32)
609
610         if t.Hour() < 10 {
611                 b = append(b, '0')
612         }
613
614         b = strconv.AppendInt(b, int64(t.Hour()), 10)
615         b = append(b, ka.timeSeparator...)
616
617         if t.Minute() < 10 {
618                 b = append(b, '0')
619         }
620
621         b = strconv.AppendInt(b, int64(t.Minute()), 10)
622         b = append(b, ka.timeSeparator...)
623
624         if t.Second() < 10 {
625                 b = append(b, '0')
626         }
627
628         b = strconv.AppendInt(b, int64(t.Second()), 10)
629         b = append(b, []byte{0x20}...)
630
631         tz, _ := t.Zone()
632
633         if btz, ok := ka.timezones[tz]; ok {
634                 b = append(b, btz...)
635         } else {
636                 b = append(b, tz...)
637         }
638
639         return string(b)
640 }