1 package dsb
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 dsb 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
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
46 func New() locales.Translator {
47 return &dsb{
48 locale: "dsb",
49 pluralsCardinal: []locales.PluralRule{2, 3, 4, 6},
50 pluralsOrdinal: []locales.PluralRule{6},
51 pluralsRange: nil,
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", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "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", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "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", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "zł", "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", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UYW", "UZS", "VEB", "VEF", "VES", "₫", "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{"", "jan.", "feb.", "měr.", "apr.", "maj.", "jun.", "jul.", "awg.", "sep.", "okt.", "now.", "dec."},
64 monthsNarrow: []string{"", "j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"},
65 monthsWide: []string{"", "januara", "februara", "měrca", "apryla", "maja", "junija", "julija", "awgusta", "septembra", "oktobra", "nowembra", "decembra"},
66 daysAbbreviated: []string{"nje", "pón", "wał", "srj", "stw", "pět", "sob"},
67 daysNarrow: []string{"n", "p", "w", "s", "s", "p", "s"},
68 daysShort: []string{"nj", "pó", "wa", "sr", "st", "pě", "so"},
69 daysWide: []string{"njeźela", "pónjeźele", "wałtora", "srjoda", "stwórtk", "pětk", "sobota"},
70 periodsAbbreviated: []string{"dopołdnja", "wótpołdnja"},
71 periodsNarrow: []string{"dop.", "wótp."},
72 periodsWide: []string{"dopołdnja", "wótpołdnja"},
73 erasAbbreviated: []string{"pś.Chr.n.", "pó Chr.n."},
74 erasNarrow: []string{"", ""},
75 erasWide: []string{"pśed Kristusowym naroźenim", "pó Kristusowem naroźenju"},
76 timezones: map[string]string{"ACDT": "Srjejźoawstralski lěśojski cas", "ACST": "Srjejźoawstralski standardny cas", "ACWDT": "Srjejźopódwjacorny awstralski lěśojski cas", "ACWST": "Srjejźopódwjacorny awstralski standardny cas", "ADT": "Atlantiski lěśojski cas", "AEDT": "Pódzajtšnoawstralski lěśojski cas", "AEST": "Pódzajtšnoawstralski standardny cas", "AKDT": "Alaskojski lěśojski cas", "AKST": "Alaskojski standardny cas", "ARST": "Argentinski lěśojski cas", "ART": "Argentinski standardny cas", "AST": "Atlantiski standardny cas", "AWDT": "Pódwjacornoawstralski lěśojski cas", "AWST": "Pódwjacornoawstralski standardny cas", "BOT": "Boliwiski cas", "BT": "Bhutański cas", "CAT": "Srjejźoafriski cas", "CDT": "Pódpołnocnoameriski centralny lěśojski cas", "CHADT": "Chathamski lěśojski cas", "CHAST": "Chathamski standardny cas", "CLST": "Chilski lěśojski cas", "CLT": "Chilski standardny cas", "COST": "Kolumbiski lěśojski cas", "COT": "Kolumbiski standardny cas", "CST": "Pódpołnocnoameriski centralny standardny cas", "ChST": "Chamorrski cas", "EAT": "Pódzajtšnoafriski cas", "ECT": "Ekuadorski cas", "EDT": "Pódpołnocnoameriski pódzajtšny lěśojski cas", "EST": "Pódpołnocnoameriski pódzajtšny standardny cas", "GFT": "Francojskoguyański cas", "GMT": "Greenwichski cas", "GST": "cas Persiskego golfa", "GYT": "Guyański cas", "HADT": "Hawaiisko-aleutski lěśojski cas", "HAST": "Hawaiisko-aleutski standardny cas", "HAT": "Nowofundlandski lěśojski cas", "HECU": "Kubański lěśojski cas", "HEEG": "Pódzajtšnogrönlandski lěśojski cas", "HENOMX": "Mexiski dłujkowjacorny lěśojski cas", "HEOG": "Pódwjacornogrönlandski lěśojski cas", "HEPM": "St.-Pierre-a-Miqueloński lěśojski cas", "HEPMX": "Mexiski pacifiski lěśojski cas", "HKST": "Hongkongski lěśojski cas", "HKT": "Hongkongski standardny cas", "HNCU": "Kubański standardny cas", "HNEG": "Pódzajtšnogrönlandski standardny cas", "HNNOMX": "Mexiski dłujkowjacorny standardny cas", "HNOG": "Pódwjacornogrönlandski standardny cas", "HNPM": "St.-Pierre-a-Miqueloński standardny cas", "HNPMX": "Mexiski pacifiski standardny cas", "HNT": "Nowofundlandski standardny cas", "IST": "Indiski cas", "JDT": "Japański lěśojski cas", "JST": "Japański standardny cas", "LHDT": "lěśojski cas kupy Lord-Howe", "LHST": "Standardny cas kupy Lord-Howe", "MDT": "Pódpołnocnoameriski górski lěśojski cas", "MESZ": "Srjejźoeuropski lěśojski cas", "MEZ": "Srjejźoeuropski standardny cas", "MST": "Pódpołnocnoameriski górski standardny cas", "MYT": "Malajziski cas", "NZDT": "Nowoseelandski lěśojski cas", "NZST": "Nowoseelandski standardny cas", "OESZ": "Pódzajtšnoeuropski lěśojski cas", "OEZ": "Pódzajtšnoeuropski standardny cas", "PDT": "Pódpołnocnoameriski pacifiski lěśojski cas", "PST": "Pódpołnocnoameriski pacifiski standardny cas", "SAST": "Pódpołdnjowoafriski cas", "SGT": "Singapurski cas", "SRT": "Surinamski cas", "TMST": "Turkmeniski lěśojski cas", "TMT": "Turkmeniski standardny cas", "UYST": "Uruguayski lěśojski cas", "UYT": "Uruguayski standardny cas", "VET": "Venezuelski cas", "WARST": "Pódwjacornoargentinski lěśojski cas", "WART": "Pódwjacornoargentinski standardny cas", "WAST": "Pódwjacornoafriski lěśojski cas", "WAT": "Pódwjacornoafriski standardny cas", "WESZ": "Pódwjacornoeuropski lěśojski cas", "WEZ": "Pódwjacornoeuropski standardny cas", "WIB": "Pódwjacornoindoneski cas", "WIT": "Pódzajtšnoindoneski", "WITA": "Srjejźoindoneski cas", "∅∅∅": "Acorski lěśojski cas"},
77 }
78 }
79
80
81 func (dsb *dsb) Locale() string {
82 return dsb.locale
83 }
84
85
86 func (dsb *dsb) PluralsCardinal() []locales.PluralRule {
87 return dsb.pluralsCardinal
88 }
89
90
91 func (dsb *dsb) PluralsOrdinal() []locales.PluralRule {
92 return dsb.pluralsOrdinal
93 }
94
95
96 func (dsb *dsb) PluralsRange() []locales.PluralRule {
97 return dsb.pluralsRange
98 }
99
100
101 func (dsb *dsb) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
102
103 n := math.Abs(num)
104 i := int64(n)
105 f := locales.F(n, v)
106 iMod100 := i % 100
107 fMod100 := f % 100
108
109 if (v == 0 && iMod100 == 1) || (fMod100 == 1) {
110 return locales.PluralRuleOne
111 } else if (v == 0 && iMod100 == 2) || (fMod100 == 2) {
112 return locales.PluralRuleTwo
113 } else if (v == 0 && iMod100 >= 3 && iMod100 <= 4) || (fMod100 >= 3 && fMod100 <= 4) {
114 return locales.PluralRuleFew
115 }
116
117 return locales.PluralRuleOther
118 }
119
120
121 func (dsb *dsb) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
122 return locales.PluralRuleOther
123 }
124
125
126 func (dsb *dsb) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
127 return locales.PluralRuleUnknown
128 }
129
130
131 func (dsb *dsb) MonthAbbreviated(month time.Month) string {
132 return dsb.monthsAbbreviated[month]
133 }
134
135
136 func (dsb *dsb) MonthsAbbreviated() []string {
137 return dsb.monthsAbbreviated[1:]
138 }
139
140
141 func (dsb *dsb) MonthNarrow(month time.Month) string {
142 return dsb.monthsNarrow[month]
143 }
144
145
146 func (dsb *dsb) MonthsNarrow() []string {
147 return dsb.monthsNarrow[1:]
148 }
149
150
151 func (dsb *dsb) MonthWide(month time.Month) string {
152 return dsb.monthsWide[month]
153 }
154
155
156 func (dsb *dsb) MonthsWide() []string {
157 return dsb.monthsWide[1:]
158 }
159
160
161 func (dsb *dsb) WeekdayAbbreviated(weekday time.Weekday) string {
162 return dsb.daysAbbreviated[weekday]
163 }
164
165
166 func (dsb *dsb) WeekdaysAbbreviated() []string {
167 return dsb.daysAbbreviated
168 }
169
170
171 func (dsb *dsb) WeekdayNarrow(weekday time.Weekday) string {
172 return dsb.daysNarrow[weekday]
173 }
174
175
176 func (dsb *dsb) WeekdaysNarrow() []string {
177 return dsb.daysNarrow
178 }
179
180
181 func (dsb *dsb) WeekdayShort(weekday time.Weekday) string {
182 return dsb.daysShort[weekday]
183 }
184
185
186 func (dsb *dsb) WeekdaysShort() []string {
187 return dsb.daysShort
188 }
189
190
191 func (dsb *dsb) WeekdayWide(weekday time.Weekday) string {
192 return dsb.daysWide[weekday]
193 }
194
195
196 func (dsb *dsb) WeekdaysWide() []string {
197 return dsb.daysWide
198 }
199
200
201 func (dsb *dsb) Decimal() string {
202 return dsb.decimal
203 }
204
205
206 func (dsb *dsb) Group() string {
207 return dsb.group
208 }
209
210
211 func (dsb *dsb) Minus() string {
212 return dsb.minus
213 }
214
215
216 func (dsb *dsb) FmtNumber(num float64, v uint64) string {
217
218 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
219 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
220 count := 0
221 inWhole := v == 0
222 b := make([]byte, 0, l)
223
224 for i := len(s) - 1; i >= 0; i-- {
225
226 if s[i] == '.' {
227 b = append(b, dsb.decimal[0])
228 inWhole = true
229 continue
230 }
231
232 if inWhole {
233 if count == 3 {
234 b = append(b, dsb.group[0])
235 count = 1
236 } else {
237 count++
238 }
239 }
240
241 b = append(b, s[i])
242 }
243
244 if num < 0 {
245 b = append(b, dsb.minus[0])
246 }
247
248
249 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
250 b[i], b[j] = b[j], b[i]
251 }
252
253 return string(b)
254 }
255
256
257
258 func (dsb *dsb) FmtPercent(num float64, v uint64) string {
259 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
260 l := len(s) + 5
261 b := make([]byte, 0, l)
262
263 for i := len(s) - 1; i >= 0; i-- {
264
265 if s[i] == '.' {
266 b = append(b, dsb.decimal[0])
267 continue
268 }
269
270 b = append(b, s[i])
271 }
272
273 if num < 0 {
274 b = append(b, dsb.minus[0])
275 }
276
277
278 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
279 b[i], b[j] = b[j], b[i]
280 }
281
282 b = append(b, dsb.percentSuffix...)
283
284 b = append(b, dsb.percent...)
285
286 return string(b)
287 }
288
289
290 func (dsb *dsb) FmtCurrency(num float64, v uint64, currency currency.Type) string {
291
292 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
293 symbol := dsb.currencies[currency]
294 l := len(s) + len(symbol) + 4 + 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, dsb.decimal[0])
303 inWhole = true
304 continue
305 }
306
307 if inWhole {
308 if count == 3 {
309 b = append(b, dsb.group[0])
310 count = 1
311 } else {
312 count++
313 }
314 }
315
316 b = append(b, s[i])
317 }
318
319 if num < 0 {
320 b = append(b, dsb.minus[0])
321 }
322
323
324 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
325 b[i], b[j] = b[j], b[i]
326 }
327
328 if int(v) < 2 {
329
330 if v == 0 {
331 b = append(b, dsb.decimal...)
332 }
333
334 for i := 0; i < 2-int(v); i++ {
335 b = append(b, '0')
336 }
337 }
338
339 b = append(b, dsb.currencyPositiveSuffix...)
340
341 b = append(b, symbol...)
342
343 return string(b)
344 }
345
346
347
348 func (dsb *dsb) FmtAccounting(num float64, v uint64, currency currency.Type) string {
349
350 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
351 symbol := dsb.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, dsb.decimal[0])
361 inWhole = true
362 continue
363 }
364
365 if inWhole {
366 if count == 3 {
367 b = append(b, dsb.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 b = append(b, dsb.minus[0])
380
381 }
382
383
384 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
385 b[i], b[j] = b[j], b[i]
386 }
387
388 if int(v) < 2 {
389
390 if v == 0 {
391 b = append(b, dsb.decimal...)
392 }
393
394 for i := 0; i < 2-int(v); i++ {
395 b = append(b, '0')
396 }
397 }
398
399 if num < 0 {
400 b = append(b, dsb.currencyNegativeSuffix...)
401 b = append(b, symbol...)
402 } else {
403
404 b = append(b, dsb.currencyPositiveSuffix...)
405 b = append(b, symbol...)
406 }
407
408 return string(b)
409 }
410
411
412 func (dsb *dsb) FmtDateShort(t time.Time) string {
413
414 b := make([]byte, 0, 32)
415
416 b = strconv.AppendInt(b, int64(t.Day()), 10)
417 b = append(b, []byte{0x2e}...)
418 b = strconv.AppendInt(b, int64(t.Month()), 10)
419 b = append(b, []byte{0x2e}...)
420
421 if t.Year() > 9 {
422 b = append(b, strconv.Itoa(t.Year())[2:]...)
423 } else {
424 b = append(b, strconv.Itoa(t.Year())[1:]...)
425 }
426
427 return string(b)
428 }
429
430
431 func (dsb *dsb) FmtDateMedium(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}...)
437 b = strconv.AppendInt(b, int64(t.Month()), 10)
438 b = append(b, []byte{0x2e}...)
439
440 if t.Year() > 0 {
441 b = strconv.AppendInt(b, int64(t.Year()), 10)
442 } else {
443 b = strconv.AppendInt(b, int64(-t.Year()), 10)
444 }
445
446 return string(b)
447 }
448
449
450 func (dsb *dsb) FmtDateLong(t time.Time) string {
451
452 b := make([]byte, 0, 32)
453
454 b = strconv.AppendInt(b, int64(t.Day()), 10)
455 b = append(b, []byte{0x2e, 0x20}...)
456 b = append(b, dsb.monthsWide[t.Month()]...)
457 b = append(b, []byte{0x20}...)
458
459 if t.Year() > 0 {
460 b = strconv.AppendInt(b, int64(t.Year()), 10)
461 } else {
462 b = strconv.AppendInt(b, int64(-t.Year()), 10)
463 }
464
465 return string(b)
466 }
467
468
469 func (dsb *dsb) FmtDateFull(t time.Time) string {
470
471 b := make([]byte, 0, 32)
472
473 b = append(b, dsb.daysWide[t.Weekday()]...)
474 b = append(b, []byte{0x2c, 0x20}...)
475 b = strconv.AppendInt(b, int64(t.Day()), 10)
476 b = append(b, []byte{0x2e, 0x20}...)
477 b = append(b, dsb.monthsWide[t.Month()]...)
478 b = append(b, []byte{0x20}...)
479
480 if t.Year() > 0 {
481 b = strconv.AppendInt(b, int64(t.Year()), 10)
482 } else {
483 b = strconv.AppendInt(b, int64(-t.Year()), 10)
484 }
485
486 return string(b)
487 }
488
489
490 func (dsb *dsb) FmtTimeShort(t time.Time) string {
491
492 b := make([]byte, 0, 32)
493
494 b = strconv.AppendInt(b, int64(t.Hour()), 10)
495 b = append(b, dsb.timeSeparator...)
496
497 if t.Minute() < 10 {
498 b = append(b, '0')
499 }
500
501 b = strconv.AppendInt(b, int64(t.Minute()), 10)
502
503 return string(b)
504 }
505
506
507 func (dsb *dsb) FmtTimeMedium(t time.Time) string {
508
509 b := make([]byte, 0, 32)
510
511 b = strconv.AppendInt(b, int64(t.Hour()), 10)
512 b = append(b, dsb.timeSeparator...)
513
514 if t.Minute() < 10 {
515 b = append(b, '0')
516 }
517
518 b = strconv.AppendInt(b, int64(t.Minute()), 10)
519 b = append(b, dsb.timeSeparator...)
520
521 if t.Second() < 10 {
522 b = append(b, '0')
523 }
524
525 b = strconv.AppendInt(b, int64(t.Second()), 10)
526
527 return string(b)
528 }
529
530
531 func (dsb *dsb) FmtTimeLong(t time.Time) string {
532
533 b := make([]byte, 0, 32)
534
535 b = strconv.AppendInt(b, int64(t.Hour()), 10)
536 b = append(b, dsb.timeSeparator...)
537
538 if t.Minute() < 10 {
539 b = append(b, '0')
540 }
541
542 b = strconv.AppendInt(b, int64(t.Minute()), 10)
543 b = append(b, dsb.timeSeparator...)
544
545 if t.Second() < 10 {
546 b = append(b, '0')
547 }
548
549 b = strconv.AppendInt(b, int64(t.Second()), 10)
550 b = append(b, []byte{0x20}...)
551
552 tz, _ := t.Zone()
553 b = append(b, tz...)
554
555 return string(b)
556 }
557
558
559 func (dsb *dsb) FmtTimeFull(t time.Time) string {
560
561 b := make([]byte, 0, 32)
562
563 b = strconv.AppendInt(b, int64(t.Hour()), 10)
564 b = append(b, dsb.timeSeparator...)
565
566 if t.Minute() < 10 {
567 b = append(b, '0')
568 }
569
570 b = strconv.AppendInt(b, int64(t.Minute()), 10)
571 b = append(b, dsb.timeSeparator...)
572
573 if t.Second() < 10 {
574 b = append(b, '0')
575 }
576
577 b = strconv.AppendInt(b, int64(t.Second()), 10)
578 b = append(b, []byte{0x20}...)
579
580 tz, _ := t.Zone()
581
582 if btz, ok := dsb.timezones[tz]; ok {
583 b = append(b, btz...)
584 } else {
585 b = append(b, tz...)
586 }
587
588 return string(b)
589 }
590
View as plain text