1 package tr_CY
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 tr_CY 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
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
45 func New() locales.Translator {
46 return &tr_CY{
47 locale: "tr_CY",
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", "CNH", "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", "MRU", "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", "STN", "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", "UYW", "UZS", "VEB", "VEF", "VES", "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{"", "Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"},
62 monthsNarrow: []string{"", "O", "Ş", "M", "N", "M", "H", "T", "A", "E", "E", "K", "A"},
63 monthsWide: []string{"", "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"},
64 daysAbbreviated: []string{"Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"},
65 daysNarrow: []string{"P", "P", "S", "Ç", "P", "C", "C"},
66 daysShort: []string{"Pa", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct"},
67 daysWide: []string{"Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"},
68 periodsAbbreviated: []string{"ÖÖ", "ÖS"},
69 periodsNarrow: []string{"öö", "ös"},
70 periodsWide: []string{"ÖÖ", "ÖS"},
71 erasAbbreviated: []string{"MÖ", "MS"},
72 erasNarrow: []string{"", ""},
73 erasWide: []string{"Milattan Önce", "Milattan Sonra"},
74 timezones: map[string]string{"ACDT": "Orta Avustralya Yaz Saati", "ACST": "Orta Avustralya Standart Saati", "ACWDT": "İç Batı Avustralya Yaz Saati", "ACWST": "İç Batı Avustralya Standart Saati", "ADT": "Atlantik Yaz Saati", "AEDT": "Doğu Avustralya Yaz Saati", "AEST": "Doğu Avustralya Standart Saati", "AKDT": "Alaska Yaz Saati", "AKST": "Alaska Standart Saati", "ARST": "Arjantin Yaz Saati", "ART": "Arjantin Standart Saati", "AST": "Atlantik Standart Saati", "AWDT": "Batı Avustralya Yaz Saati", "AWST": "Batı Avustralya Standart Saati", "BOT": "Bolivya Saati", "BT": "Butan Saati", "CAT": "Orta Afrika Saati", "CDT": "Kuzey Amerika Merkezi Yaz Saati", "CHADT": "Chatham Yaz Saati", "CHAST": "Chatham Standart Saati", "CLST": "Şili Yaz Saati", "CLT": "Şili Standart Saati", "COST": "Kolombiya Yaz Saati", "COT": "Kolombiya Standart Saati", "CST": "Kuzey Amerika Merkezi Standart Saati", "ChST": "Chamorro Saati", "EAT": "Doğu Afrika Saati", "ECT": "Ekvador Saati", "EDT": "Kuzey Amerika Doğu Yaz Saati", "EST": "Kuzey Amerika Doğu Standart Saati", "GFT": "Fransız Guyanası Saati", "GMT": "Greenwich Ortalama Saati", "GST": "Körfez Saati", "GYT": "Guyana Saati", "HADT": "Hawaii-Aleut Yaz Saati", "HAST": "Hawaii-Aleut Standart Saati", "HAT": "Newfoundland Yaz Saati", "HECU": "Küba Yaz Saati", "HEEG": "Doğu Grönland Yaz Saati", "HENOMX": "Kuzeybatı Meksika Yaz Saati", "HEOG": "Batı Grönland Yaz Saati", "HEPM": "Saint Pierre ve Miquelon Yaz Saati", "HEPMX": "Meksika Pasifik Kıyısı Yaz Saati", "HKST": "Hong Kong Yaz Saati", "HKT": "Hong Kong Standart Saati", "HNCU": "Küba Standart Saati", "HNEG": "Doğu Grönland Standart Saati", "HNNOMX": "Kuzeybatı Meksika Standart Saati", "HNOG": "Batı Grönland Standart Saati", "HNPM": "Saint Pierre ve Miquelon Standart Saati", "HNPMX": "Meksika Pasifik Kıyısı Standart Saati", "HNT": "Newfoundland Standart Saati", "IST": "Hindistan Standart Saati", "JDT": "Japonya Yaz Saati", "JST": "Japonya Standart Saati", "LHDT": "Lord Howe Yaz Saati", "LHST": "Lord Howe Standart Saati", "MDT": "Makao Yaz Saati", "MESZ": "Orta Avrupa Yaz Saati", "MEZ": "Orta Avrupa Standart Saati", "MST": "Makao Standart Saati", "MYT": "Malezya Saati", "NZDT": "Yeni Zelanda Yaz Saati", "NZST": "Yeni Zelanda Standart Saati", "OESZ": "Doğu Avrupa Yaz Saati", "OEZ": "Doğu Avrupa Standart Saati", "PDT": "Kuzey Amerika Pasifik Yaz Saati", "PST": "Kuzey Amerika Pasifik Standart Saati", "SAST": "Güney Afrika Standart Saati", "SGT": "Singapur Standart Saati", "SRT": "Surinam Saati", "TMST": "Türkmenistan Yaz Saati", "TMT": "Türkmenistan Standart Saati", "UYST": "Uruguay Yaz Saati", "UYT": "Uruguay Standart Saati", "VET": "Venezuela Saati", "WARST": "Batı Arjantin Yaz Saati", "WART": "Batı Arjantin Standart Saati", "WAST": "Batı Afrika Yaz Saati", "WAT": "Batı Afrika Standart Saati", "WESZ": "Batı Avrupa Yaz Saati", "WEZ": "Batı Avrupa Standart Saati", "WIB": "Batı Endonezya Saati", "WIT": "Doğu Endonezya Saati", "WITA": "Orta Endonezya Saati", "∅∅∅": "Peru Yaz Saati"},
75 }
76 }
77
78
79 func (tr *tr_CY) Locale() string {
80 return tr.locale
81 }
82
83
84 func (tr *tr_CY) PluralsCardinal() []locales.PluralRule {
85 return tr.pluralsCardinal
86 }
87
88
89 func (tr *tr_CY) PluralsOrdinal() []locales.PluralRule {
90 return tr.pluralsOrdinal
91 }
92
93
94 func (tr *tr_CY) PluralsRange() []locales.PluralRule {
95 return tr.pluralsRange
96 }
97
98
99 func (tr *tr_CY) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101 n := math.Abs(num)
102
103 if n == 1 {
104 return locales.PluralRuleOne
105 }
106
107 return locales.PluralRuleOther
108 }
109
110
111 func (tr *tr_CY) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
112 return locales.PluralRuleOther
113 }
114
115
116 func (tr *tr_CY) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
117
118 start := tr.CardinalPluralRule(num1, v1)
119 end := tr.CardinalPluralRule(num2, v2)
120
121 if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
122 return locales.PluralRuleOther
123 } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
124 return locales.PluralRuleOne
125 }
126
127 return locales.PluralRuleOther
128
129 }
130
131
132 func (tr *tr_CY) MonthAbbreviated(month time.Month) string {
133 return tr.monthsAbbreviated[month]
134 }
135
136
137 func (tr *tr_CY) MonthsAbbreviated() []string {
138 return tr.monthsAbbreviated[1:]
139 }
140
141
142 func (tr *tr_CY) MonthNarrow(month time.Month) string {
143 return tr.monthsNarrow[month]
144 }
145
146
147 func (tr *tr_CY) MonthsNarrow() []string {
148 return tr.monthsNarrow[1:]
149 }
150
151
152 func (tr *tr_CY) MonthWide(month time.Month) string {
153 return tr.monthsWide[month]
154 }
155
156
157 func (tr *tr_CY) MonthsWide() []string {
158 return tr.monthsWide[1:]
159 }
160
161
162 func (tr *tr_CY) WeekdayAbbreviated(weekday time.Weekday) string {
163 return tr.daysAbbreviated[weekday]
164 }
165
166
167 func (tr *tr_CY) WeekdaysAbbreviated() []string {
168 return tr.daysAbbreviated
169 }
170
171
172 func (tr *tr_CY) WeekdayNarrow(weekday time.Weekday) string {
173 return tr.daysNarrow[weekday]
174 }
175
176
177 func (tr *tr_CY) WeekdaysNarrow() []string {
178 return tr.daysNarrow
179 }
180
181
182 func (tr *tr_CY) WeekdayShort(weekday time.Weekday) string {
183 return tr.daysShort[weekday]
184 }
185
186
187 func (tr *tr_CY) WeekdaysShort() []string {
188 return tr.daysShort
189 }
190
191
192 func (tr *tr_CY) WeekdayWide(weekday time.Weekday) string {
193 return tr.daysWide[weekday]
194 }
195
196
197 func (tr *tr_CY) WeekdaysWide() []string {
198 return tr.daysWide
199 }
200
201
202 func (tr *tr_CY) Decimal() string {
203 return tr.decimal
204 }
205
206
207 func (tr *tr_CY) Group() string {
208 return tr.group
209 }
210
211
212 func (tr *tr_CY) Minus() string {
213 return tr.minus
214 }
215
216
217 func (tr *tr_CY) FmtNumber(num float64, v uint64) string {
218
219 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
220 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
221 count := 0
222 inWhole := v == 0
223 b := make([]byte, 0, l)
224
225 for i := len(s) - 1; i >= 0; i-- {
226
227 if s[i] == '.' {
228 b = append(b, tr.decimal[0])
229 inWhole = true
230 continue
231 }
232
233 if inWhole {
234 if count == 3 {
235 b = append(b, tr.group[0])
236 count = 1
237 } else {
238 count++
239 }
240 }
241
242 b = append(b, s[i])
243 }
244
245 if num < 0 {
246 b = append(b, tr.minus[0])
247 }
248
249
250 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
251 b[i], b[j] = b[j], b[i]
252 }
253
254 return string(b)
255 }
256
257
258
259 func (tr *tr_CY) FmtPercent(num float64, v uint64) string {
260 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
261 l := len(s) + 3 + 1*len(s[:len(s)-int(v)-1])/3
262 count := 0
263 inWhole := v == 0
264 b := make([]byte, 0, l)
265
266 for i := len(s) - 1; i >= 0; i-- {
267
268 if s[i] == '.' {
269 b = append(b, tr.decimal[0])
270 inWhole = true
271
272 continue
273 }
274
275 if inWhole {
276 if count == 3 {
277 b = append(b, tr.group[0])
278 count = 1
279 } else {
280 count++
281 }
282 }
283
284 b = append(b, s[i])
285 }
286
287 if num < 0 {
288 b = append(b, tr.minus[0])
289 }
290
291 b = append(b, tr.percent[0])
292
293
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 return string(b)
299 }
300
301
302 func (tr *tr_CY) FmtCurrency(num float64, v uint64, currency currency.Type) string {
303
304 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
305 symbol := tr.currencies[currency]
306 l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
307 count := 0
308 inWhole := v == 0
309 b := make([]byte, 0, l)
310
311 for i := len(s) - 1; i >= 0; i-- {
312
313 if s[i] == '.' {
314 b = append(b, tr.decimal[0])
315 inWhole = true
316 continue
317 }
318
319 if inWhole {
320 if count == 3 {
321 b = append(b, tr.group[0])
322 count = 1
323 } else {
324 count++
325 }
326 }
327
328 b = append(b, s[i])
329 }
330
331 for j := len(symbol) - 1; j >= 0; j-- {
332 b = append(b, symbol[j])
333 }
334
335 if num < 0 {
336 b = append(b, tr.minus[0])
337 }
338
339
340 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
341 b[i], b[j] = b[j], b[i]
342 }
343
344 if int(v) < 2 {
345
346 if v == 0 {
347 b = append(b, tr.decimal...)
348 }
349
350 for i := 0; i < 2-int(v); i++ {
351 b = append(b, '0')
352 }
353 }
354
355 return string(b)
356 }
357
358
359
360 func (tr *tr_CY) FmtAccounting(num float64, v uint64, currency currency.Type) string {
361
362 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
363 symbol := tr.currencies[currency]
364 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
365 count := 0
366 inWhole := v == 0
367 b := make([]byte, 0, l)
368
369 for i := len(s) - 1; i >= 0; i-- {
370
371 if s[i] == '.' {
372 b = append(b, tr.decimal[0])
373 inWhole = true
374 continue
375 }
376
377 if inWhole {
378 if count == 3 {
379 b = append(b, tr.group[0])
380 count = 1
381 } else {
382 count++
383 }
384 }
385
386 b = append(b, s[i])
387 }
388
389 if num < 0 {
390
391 for j := len(symbol) - 1; j >= 0; j-- {
392 b = append(b, symbol[j])
393 }
394
395 b = append(b, tr.currencyNegativePrefix[0])
396
397 } else {
398
399 for j := len(symbol) - 1; j >= 0; j-- {
400 b = append(b, symbol[j])
401 }
402
403 }
404
405
406 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
407 b[i], b[j] = b[j], b[i]
408 }
409
410 if int(v) < 2 {
411
412 if v == 0 {
413 b = append(b, tr.decimal...)
414 }
415
416 for i := 0; i < 2-int(v); i++ {
417 b = append(b, '0')
418 }
419 }
420
421 if num < 0 {
422 b = append(b, tr.currencyNegativeSuffix...)
423 }
424
425 return string(b)
426 }
427
428
429 func (tr *tr_CY) FmtDateShort(t time.Time) string {
430
431 b := make([]byte, 0, 32)
432
433 b = strconv.AppendInt(b, int64(t.Day()), 10)
434 b = append(b, []byte{0x2e}...)
435
436 if t.Month() < 10 {
437 b = append(b, '0')
438 }
439
440 b = strconv.AppendInt(b, int64(t.Month()), 10)
441
442 b = append(b, []byte{0x2e}...)
443
444 if t.Year() > 0 {
445 b = strconv.AppendInt(b, int64(t.Year()), 10)
446 } else {
447 b = strconv.AppendInt(b, int64(-t.Year()), 10)
448 }
449
450 return string(b)
451 }
452
453
454 func (tr *tr_CY) FmtDateMedium(t time.Time) string {
455
456 b := make([]byte, 0, 32)
457
458 b = strconv.AppendInt(b, int64(t.Day()), 10)
459 b = append(b, []byte{0x20}...)
460 b = append(b, tr.monthsAbbreviated[t.Month()]...)
461 b = append(b, []byte{0x20}...)
462
463 if t.Year() > 0 {
464 b = strconv.AppendInt(b, int64(t.Year()), 10)
465 } else {
466 b = strconv.AppendInt(b, int64(-t.Year()), 10)
467 }
468
469 return string(b)
470 }
471
472
473 func (tr *tr_CY) 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{0x20}...)
479 b = append(b, tr.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 return string(b)
489 }
490
491
492 func (tr *tr_CY) FmtDateFull(t time.Time) string {
493
494 b := make([]byte, 0, 32)
495
496 b = strconv.AppendInt(b, int64(t.Day()), 10)
497 b = append(b, []byte{0x20}...)
498 b = append(b, tr.monthsWide[t.Month()]...)
499 b = append(b, []byte{0x20}...)
500
501 if t.Year() > 0 {
502 b = strconv.AppendInt(b, int64(t.Year()), 10)
503 } else {
504 b = strconv.AppendInt(b, int64(-t.Year()), 10)
505 }
506
507 b = append(b, []byte{0x20}...)
508 b = append(b, tr.daysWide[t.Weekday()]...)
509
510 return string(b)
511 }
512
513
514 func (tr *tr_CY) FmtTimeShort(t time.Time) string {
515
516 b := make([]byte, 0, 32)
517
518 h := t.Hour()
519
520 if h > 12 {
521 h -= 12
522 }
523
524 b = strconv.AppendInt(b, int64(h), 10)
525 b = append(b, tr.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, []byte{0x20}...)
533
534 if t.Hour() < 12 {
535 b = append(b, tr.periodsAbbreviated[0]...)
536 } else {
537 b = append(b, tr.periodsAbbreviated[1]...)
538 }
539
540 return string(b)
541 }
542
543
544 func (tr *tr_CY) FmtTimeMedium(t time.Time) string {
545
546 b := make([]byte, 0, 32)
547
548 h := t.Hour()
549
550 if h > 12 {
551 h -= 12
552 }
553
554 b = strconv.AppendInt(b, int64(h), 10)
555 b = append(b, tr.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, tr.timeSeparator...)
563
564 if t.Second() < 10 {
565 b = append(b, '0')
566 }
567
568 b = strconv.AppendInt(b, int64(t.Second()), 10)
569 b = append(b, []byte{0x20}...)
570
571 if t.Hour() < 12 {
572 b = append(b, tr.periodsAbbreviated[0]...)
573 } else {
574 b = append(b, tr.periodsAbbreviated[1]...)
575 }
576
577 return string(b)
578 }
579
580
581 func (tr *tr_CY) FmtTimeLong(t time.Time) string {
582
583 b := make([]byte, 0, 32)
584
585 h := t.Hour()
586
587 if h > 12 {
588 h -= 12
589 }
590
591 b = strconv.AppendInt(b, int64(h), 10)
592 b = append(b, tr.timeSeparator...)
593
594 if t.Minute() < 10 {
595 b = append(b, '0')
596 }
597
598 b = strconv.AppendInt(b, int64(t.Minute()), 10)
599 b = append(b, tr.timeSeparator...)
600
601 if t.Second() < 10 {
602 b = append(b, '0')
603 }
604
605 b = strconv.AppendInt(b, int64(t.Second()), 10)
606 b = append(b, []byte{0x20}...)
607
608 if t.Hour() < 12 {
609 b = append(b, tr.periodsAbbreviated[0]...)
610 } else {
611 b = append(b, tr.periodsAbbreviated[1]...)
612 }
613
614 b = append(b, []byte{0x20}...)
615
616 tz, _ := t.Zone()
617 b = append(b, tz...)
618
619 return string(b)
620 }
621
622
623 func (tr *tr_CY) FmtTimeFull(t time.Time) string {
624
625 b := make([]byte, 0, 32)
626
627 h := t.Hour()
628
629 if h > 12 {
630 h -= 12
631 }
632
633 b = strconv.AppendInt(b, int64(h), 10)
634 b = append(b, tr.timeSeparator...)
635
636 if t.Minute() < 10 {
637 b = append(b, '0')
638 }
639
640 b = strconv.AppendInt(b, int64(t.Minute()), 10)
641 b = append(b, tr.timeSeparator...)
642
643 if t.Second() < 10 {
644 b = append(b, '0')
645 }
646
647 b = strconv.AppendInt(b, int64(t.Second()), 10)
648 b = append(b, []byte{0x20}...)
649
650 if t.Hour() < 12 {
651 b = append(b, tr.periodsAbbreviated[0]...)
652 } else {
653 b = append(b, tr.periodsAbbreviated[1]...)
654 }
655
656 b = append(b, []byte{0x20}...)
657
658 tz, _ := t.Zone()
659
660 if btz, ok := tr.timezones[tz]; ok {
661 b = append(b, btz...)
662 } else {
663 b = append(b, tz...)
664 }
665
666 return string(b)
667 }
668
View as plain text