1 package dz_BT
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 dz_BT 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 monthsAbbreviated []string
27 monthsNarrow []string
28 monthsWide []string
29 daysAbbreviated []string
30 daysNarrow []string
31 daysShort []string
32 daysWide []string
33 periodsAbbreviated []string
34 periodsNarrow []string
35 periodsShort []string
36 periodsWide []string
37 erasAbbreviated []string
38 erasNarrow []string
39 erasWide []string
40 timezones map[string]string
41 }
42
43
44 func New() locales.Translator {
45 return &dz_BT{
46 locale: "dz_BT",
47 pluralsCardinal: []locales.PluralRule{6},
48 pluralsOrdinal: nil,
49 pluralsRange: nil,
50 decimal: ".",
51 group: ",",
52 minus: "-",
53 percent: "%",
54 perMille: "‰",
55 timeSeparator: ":",
56 inifinity: "གྲངས་མེད",
57 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"},
58 percentSuffix: " ",
59 monthsAbbreviated: []string{"", "༡", "༢", "༣", "༤", "༥", "༦", "༧", "༨", "༩", "༡༠", "༡༡", "12"},
60 monthsNarrow: []string{"", "༡", "༢", "༣", "4", "༥", "༦", "༧", "༨", "9", "༡༠", "༡༡", "༡༢"},
61 monthsWide: []string{"", "ཟླ་དངཔ་", "ཟླ་གཉིས་པ་", "ཟླ་གསུམ་པ་", "ཟླ་བཞི་པ་", "ཟླ་ལྔ་པ་", "ཟླ་དྲུག་པ", "ཟླ་བདུན་པ་", "ཟླ་བརྒྱད་པ་", "ཟླ་དགུ་པ་", "ཟླ་བཅུ་པ་", "ཟླ་བཅུ་གཅིག་པ་", "ཟླ་བཅུ་གཉིས་པ་"},
62 daysAbbreviated: []string{"ཟླ་", "མིར་", "ལྷག་", "ཕུར་", "སངས་", "སྤེན་", "ཉི་"},
63 daysNarrow: []string{"ཟླ", "མིར", "ལྷག", "ཕུར", "སངྶ", "སྤེན", "ཉི"},
64 daysShort: []string{"ཟླ་", "མིར་", "ལྷག་", "ཕུར་", "སངས་", "སྤེན་", "ཉི་"},
65 daysWide: []string{"གཟའ་ཟླ་བ་", "གཟའ་མིག་དམར་", "གཟའ་ལྷག་པ་", "གཟའ་ཕུར་བུ་", "གཟའ་པ་སངས་", "གཟའ་སྤེན་པ་", "གཟའ་ཉི་མ་"},
66 periodsAbbreviated: []string{"སྔ་ཆ་", "ཕྱི་ཆ་"},
67 periodsNarrow: []string{"སྔ་ཆ་", "ཕྱི་ཆ་"},
68 periodsWide: []string{"སྔ་ཆ་", "ཕྱི་ཆ་"},
69 erasAbbreviated: []string{"BCE", "CE"},
70 erasNarrow: []string{"", ""},
71 erasWide: []string{"", ""},
72 timezones: map[string]string{"ACDT": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "ACST": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "ACWDT": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "ACWST": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "ADT": "ཨེཊ་ལེན་ཊིཀ་ཉིན་སྲུང་ཆུ་ཚོད", "AEDT": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "AEST": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "AKDT": "ཨ་ལསི་ཀ་ཉིན་སྲུང་ཆུ་ཚོད", "AKST": "ཨ་ལསི་ཀ་ཚད་ལྡན་ཆུ་ཚོད", "ARST": "ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "ART": "ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "AST": "ཨེཊ་ལེན་ཊིཀ་ཚད་ལྡན་ཆུ་ཚོད", "AWDT": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "AWST": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "BOT": "བྷོ་ལི་བི་ཡ་ཆུ་ཚོད", "BT": "འབྲུག་ཡུལ་ཆུ་ཚོད", "CAT": "དབུས་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "CDT": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "CHADT": "CHADT", "CHAST": "CHAST", "CLST": "ཅི་ལི་བྱཱར་དུས་ཆུ་ཚོད", "CLT": "ཅི་ལི་ཚད་ལྡན་ཆུ་ཚོད", "COST": "ཀོ་ལོམ་བྷི་ཡ་བྱཱར་དུས་ཆུ་ཚོད", "COT": "ཀོ་ལོམ་བྷི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "CST": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "ChST": "ChST", "EAT": "ཤར་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "ECT": "ཨེ་ཀུ་ཌཽ་ཆུ་ཚོད", "EDT": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "EST": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "GFT": "ཕིརེནཅ་གི་ཡ་ན་ཆུ་ཚོད", "GMT": "གིརིན་ཝིཆ་ལུ་ཡོད་པའི་ཆུ་ཚོད", "GST": "གཱལཕི་ཆུ་ཚོད", "GYT": "གུ་ཡ་ན་ཆུ་ཚོད", "HADT": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཉིན་སྲུང་ཆུ་ཚོད", "HAST": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཚད་ལྡན་ཆུ་ཚོད", "HAT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "HECU": "ཀིའུ་བྷ་ཉིན་སྲུང་ཆུ་ཚོད", "HEEG": "ཤར་ཕྱོགས་གིརིན་ལེནཌ་བྱཱར་དུས་ཆུ་ཚོད", "HENOMX": "HENOMX", "HEOG": "ནུབ་ཕྱོགས་གིརིན་ལེནཌ་བྱཱར་དུས་ཆུ་ཚོད", "HEPM": "པའི་རི་དང་མི་ཀི་ལཱོན་ཉིན་སྲུང་ཆུ་ཚོད", "HEPMX": "HEPMX", "HKST": "HKST", "HKT": "HKT", "HNCU": "ཀིའུ་བྷ་ཚད་ལྡན་ཆུ་ཚོད", "HNEG": "ཤར་ཕྱོགས་གིརིན་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "HNNOMX": "HNNOMX", "HNOG": "ནུབ་ཕྱོགས་གིརིན་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "HNPM": "པའི་རི་དང་མི་ཀི་ལཱོན་ཚད་ལྡན་ཆུ་ཚོད", "HNPMX": "HNPMX", "HNT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "IST": "རྒྱ་གར་ཆུ་ཚོད", "JDT": "ཇ་པཱན་ཉིན་སྲུང་ཆུ་ཚོད", "JST": "ཇ་པཱན་ཚད་ལྡན་ཆུ་ཚོད", "LHDT": "LHDT", "LHST": "LHST", "MDT": "བྱང་ཨ་མི་རི་ཀ་མའུ་ཊེན་ཉིན་སྲུང་ཆུ་ཚོད", "MESZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "MEZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "MST": "བྱང་ཨ་མི་རི་ཀ་མའུ་ཊེན་ཚད་ལྡན་ཆུ་ཚོད", "MYT": "MYT", "NZDT": "ནིའུ་ཛི་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "NZST": "ནིའུ་ཛི་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "OESZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "OEZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "PDT": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཉིན་སྲུང་ཆུ་ཚོད", "PST": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཚད་ལྡན་ཆུ་ཚོད", "SAST": "ལྷོ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "SGT": "SGT", "SRT": "སུ་རི་ནཱམ་ཆུ་ཚོད", "TMST": "TMST", "TMT": "TMT", "UYST": "ཡུ་རུ་གུ་ཝཱའི་བྱཱར་དུས་ཆུ་ཚོད", "UYT": "ཡུ་རུ་གུ་ཝཱའི་ཚད་ལྡན་ཆུ་ཚོད", "VET": "བེ་ནི་ཛུ་ཝེ་ལ་ཆུ་ཚོད", "WARST": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "WART": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "WAST": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་བྱཱར་དུས་ཆུ་ཚོད", "WAT": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཚད་ལྡན་ཆུ་ཚོད", "WESZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "WEZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "WIB": "ནུབ་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "WIT": "ཤར་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "WITA": "དབུས་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "∅∅∅": "ཨེ་ཛོརས་བྱཱར་དུས་ཆུ་ཚོད"},
73 }
74 }
75
76
77 func (dz *dz_BT) Locale() string {
78 return dz.locale
79 }
80
81
82 func (dz *dz_BT) PluralsCardinal() []locales.PluralRule {
83 return dz.pluralsCardinal
84 }
85
86
87 func (dz *dz_BT) PluralsOrdinal() []locales.PluralRule {
88 return dz.pluralsOrdinal
89 }
90
91
92 func (dz *dz_BT) PluralsRange() []locales.PluralRule {
93 return dz.pluralsRange
94 }
95
96
97 func (dz *dz_BT) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
98 return locales.PluralRuleOther
99 }
100
101
102 func (dz *dz_BT) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
103 return locales.PluralRuleUnknown
104 }
105
106
107 func (dz *dz_BT) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
108 return locales.PluralRuleUnknown
109 }
110
111
112 func (dz *dz_BT) MonthAbbreviated(month time.Month) string {
113 return dz.monthsAbbreviated[month]
114 }
115
116
117 func (dz *dz_BT) MonthsAbbreviated() []string {
118 return dz.monthsAbbreviated[1:]
119 }
120
121
122 func (dz *dz_BT) MonthNarrow(month time.Month) string {
123 return dz.monthsNarrow[month]
124 }
125
126
127 func (dz *dz_BT) MonthsNarrow() []string {
128 return dz.monthsNarrow[1:]
129 }
130
131
132 func (dz *dz_BT) MonthWide(month time.Month) string {
133 return dz.monthsWide[month]
134 }
135
136
137 func (dz *dz_BT) MonthsWide() []string {
138 return dz.monthsWide[1:]
139 }
140
141
142 func (dz *dz_BT) WeekdayAbbreviated(weekday time.Weekday) string {
143 return dz.daysAbbreviated[weekday]
144 }
145
146
147 func (dz *dz_BT) WeekdaysAbbreviated() []string {
148 return dz.daysAbbreviated
149 }
150
151
152 func (dz *dz_BT) WeekdayNarrow(weekday time.Weekday) string {
153 return dz.daysNarrow[weekday]
154 }
155
156
157 func (dz *dz_BT) WeekdaysNarrow() []string {
158 return dz.daysNarrow
159 }
160
161
162 func (dz *dz_BT) WeekdayShort(weekday time.Weekday) string {
163 return dz.daysShort[weekday]
164 }
165
166
167 func (dz *dz_BT) WeekdaysShort() []string {
168 return dz.daysShort
169 }
170
171
172 func (dz *dz_BT) WeekdayWide(weekday time.Weekday) string {
173 return dz.daysWide[weekday]
174 }
175
176
177 func (dz *dz_BT) WeekdaysWide() []string {
178 return dz.daysWide
179 }
180
181
182 func (dz *dz_BT) Decimal() string {
183 return dz.decimal
184 }
185
186
187 func (dz *dz_BT) Group() string {
188 return dz.group
189 }
190
191
192 func (dz *dz_BT) Minus() string {
193 return dz.minus
194 }
195
196
197 func (dz *dz_BT) FmtNumber(num float64, v uint64) string {
198
199 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
200 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
201 count := 0
202 inWhole := v == 0
203 inSecondary := false
204 groupThreshold := 3
205
206 b := make([]byte, 0, l)
207
208 for i := len(s) - 1; i >= 0; i-- {
209
210 if s[i] == '.' {
211 b = append(b, dz.decimal[0])
212 inWhole = true
213 continue
214 }
215
216 if inWhole {
217
218 if count == groupThreshold {
219 b = append(b, dz.group[0])
220 count = 1
221
222 if !inSecondary {
223 inSecondary = true
224 groupThreshold = 2
225 }
226 } else {
227 count++
228 }
229 }
230
231 b = append(b, s[i])
232 }
233
234 if num < 0 {
235 b = append(b, dz.minus[0])
236 }
237
238
239 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
240 b[i], b[j] = b[j], b[i]
241 }
242
243 return string(b)
244 }
245
246
247
248 func (dz *dz_BT) FmtPercent(num float64, v uint64) string {
249 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
250 l := len(s) + 5
251 b := make([]byte, 0, l)
252
253 for i := len(s) - 1; i >= 0; i-- {
254
255 if s[i] == '.' {
256 b = append(b, dz.decimal[0])
257 continue
258 }
259
260 b = append(b, s[i])
261 }
262
263 if num < 0 {
264 b = append(b, dz.minus[0])
265 }
266
267
268 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
269 b[i], b[j] = b[j], b[i]
270 }
271
272 b = append(b, dz.percentSuffix...)
273
274 b = append(b, dz.percent...)
275
276 return string(b)
277 }
278
279
280 func (dz *dz_BT) FmtCurrency(num float64, v uint64, currency currency.Type) string {
281
282 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
283 symbol := dz.currencies[currency]
284 l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
285 count := 0
286 inWhole := v == 0
287 inSecondary := false
288 groupThreshold := 3
289
290 b := make([]byte, 0, l)
291
292 for i := len(s) - 1; i >= 0; i-- {
293
294 if s[i] == '.' {
295 b = append(b, dz.decimal[0])
296 inWhole = true
297 continue
298 }
299
300 if inWhole {
301
302 if count == groupThreshold {
303 b = append(b, dz.group[0])
304 count = 1
305
306 if !inSecondary {
307 inSecondary = true
308 groupThreshold = 2
309 }
310 } else {
311 count++
312 }
313 }
314
315 b = append(b, s[i])
316 }
317
318 for j := len(symbol) - 1; j >= 0; j-- {
319 b = append(b, symbol[j])
320 }
321
322 if num < 0 {
323 b = append(b, dz.minus[0])
324 }
325
326
327 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
328 b[i], b[j] = b[j], b[i]
329 }
330
331 if int(v) < 2 {
332
333 if v == 0 {
334 b = append(b, dz.decimal...)
335 }
336
337 for i := 0; i < 2-int(v); i++ {
338 b = append(b, '0')
339 }
340 }
341
342 return string(b)
343 }
344
345
346
347 func (dz *dz_BT) FmtAccounting(num float64, v uint64, currency currency.Type) string {
348
349 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
350 symbol := dz.currencies[currency]
351 l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
352 count := 0
353 inWhole := v == 0
354 inSecondary := false
355 groupThreshold := 3
356
357 b := make([]byte, 0, l)
358
359 for i := len(s) - 1; i >= 0; i-- {
360
361 if s[i] == '.' {
362 b = append(b, dz.decimal[0])
363 inWhole = true
364 continue
365 }
366
367 if inWhole {
368
369 if count == groupThreshold {
370 b = append(b, dz.group[0])
371 count = 1
372
373 if !inSecondary {
374 inSecondary = true
375 groupThreshold = 2
376 }
377 } else {
378 count++
379 }
380 }
381
382 b = append(b, s[i])
383 }
384
385 if num < 0 {
386
387 for j := len(symbol) - 1; j >= 0; j-- {
388 b = append(b, symbol[j])
389 }
390
391 b = append(b, dz.minus[0])
392
393 } else {
394
395 for j := len(symbol) - 1; j >= 0; j-- {
396 b = append(b, symbol[j])
397 }
398
399 }
400
401
402 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
403 b[i], b[j] = b[j], b[i]
404 }
405
406 if int(v) < 2 {
407
408 if v == 0 {
409 b = append(b, dz.decimal...)
410 }
411
412 for i := 0; i < 2-int(v); i++ {
413 b = append(b, '0')
414 }
415 }
416
417 return string(b)
418 }
419
420
421 func (dz *dz_BT) FmtDateShort(t time.Time) string {
422
423 b := make([]byte, 0, 32)
424
425 if t.Year() > 0 {
426 b = strconv.AppendInt(b, int64(t.Year()), 10)
427 } else {
428 b = strconv.AppendInt(b, int64(-t.Year()), 10)
429 }
430
431 b = append(b, []byte{0x2d}...)
432
433 if t.Month() < 10 {
434 b = append(b, '0')
435 }
436
437 b = strconv.AppendInt(b, int64(t.Month()), 10)
438
439 b = append(b, []byte{0x2d}...)
440
441 if t.Day() < 10 {
442 b = append(b, '0')
443 }
444
445 b = strconv.AppendInt(b, int64(t.Day()), 10)
446
447 return string(b)
448 }
449
450
451 func (dz *dz_BT) FmtDateMedium(t time.Time) string {
452
453 b := make([]byte, 0, 32)
454
455 b = append(b, []byte{0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
456
457 if t.Year() > 0 {
458 b = strconv.AppendInt(b, int64(t.Year()), 10)
459 } else {
460 b = strconv.AppendInt(b, int64(-t.Year()), 10)
461 }
462
463 b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9f, 0xe0, 0xbe, 0xb3, 0xe0, 0xbc, 0x8b}...)
464 b = append(b, dz.monthsAbbreviated[t.Month()]...)
465 b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
466
467 if t.Day() < 10 {
468 b = append(b, '0')
469 }
470
471 b = strconv.AppendInt(b, int64(t.Day()), 10)
472
473 return string(b)
474 }
475
476
477 func (dz *dz_BT) FmtDateLong(t time.Time) string {
478
479 b := make([]byte, 0, 32)
480
481 b = append(b, []byte{0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
482
483 if t.Year() > 0 {
484 b = strconv.AppendInt(b, int64(t.Year()), 10)
485 } else {
486 b = strconv.AppendInt(b, int64(-t.Year()), 10)
487 }
488
489 b = append(b, []byte{0x20}...)
490 b = append(b, dz.monthsWide[t.Month()]...)
491 b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b, 0x20}...)
492
493 if t.Day() < 10 {
494 b = append(b, '0')
495 }
496
497 b = strconv.AppendInt(b, int64(t.Day()), 10)
498
499 return string(b)
500 }
501
502
503 func (dz *dz_BT) FmtDateFull(t time.Time) string {
504
505 b := make([]byte, 0, 32)
506
507 b = append(b, dz.daysWide[t.Weekday()]...)
508 b = append(b, []byte{0x2c, 0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
509
510 if t.Year() > 0 {
511 b = strconv.AppendInt(b, int64(t.Year()), 10)
512 } else {
513 b = strconv.AppendInt(b, int64(-t.Year()), 10)
514 }
515
516 b = append(b, []byte{0x20}...)
517 b = append(b, dz.monthsWide[t.Month()]...)
518 b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
519
520 if t.Day() < 10 {
521 b = append(b, '0')
522 }
523
524 b = strconv.AppendInt(b, int64(t.Day()), 10)
525
526 return string(b)
527 }
528
529
530 func (dz *dz_BT) FmtTimeShort(t time.Time) string {
531
532 b := make([]byte, 0, 32)
533
534 b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b, 0x20}...)
535
536 h := t.Hour()
537
538 if h > 12 {
539 h -= 12
540 }
541
542 b = strconv.AppendInt(b, int64(h), 10)
543 b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0x90, 0xe0, 0xbd, 0xa2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x98, 0xe0, 0xbc, 0x8b, 0x20}...)
544
545 if t.Minute() < 10 {
546 b = append(b, '0')
547 }
548
549 b = strconv.AppendInt(b, int64(t.Minute()), 10)
550 b = append(b, []byte{0x20}...)
551
552 if t.Hour() < 12 {
553 b = append(b, dz.periodsAbbreviated[0]...)
554 } else {
555 b = append(b, dz.periodsAbbreviated[1]...)
556 }
557
558 return string(b)
559 }
560
561
562 func (dz *dz_BT) FmtTimeMedium(t time.Time) string {
563
564 b := make([]byte, 0, 32)
565
566 b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b}...)
567
568 h := t.Hour()
569
570 if h > 12 {
571 h -= 12
572 }
573
574 b = strconv.AppendInt(b, int64(h), 10)
575 b = append(b, dz.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, dz.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 if t.Hour() < 12 {
592 b = append(b, dz.periodsAbbreviated[0]...)
593 } else {
594 b = append(b, dz.periodsAbbreviated[1]...)
595 }
596
597 return string(b)
598 }
599
600
601 func (dz *dz_BT) FmtTimeLong(t time.Time) string {
602
603 b := make([]byte, 0, 32)
604
605 b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b, 0x20}...)
606
607 h := t.Hour()
608
609 if h > 12 {
610 h -= 12
611 }
612
613 b = strconv.AppendInt(b, int64(h), 10)
614 b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0x90, 0xe0, 0xbd, 0xa2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x98, 0xe0, 0xbc, 0x8b, 0x20}...)
615
616 if t.Minute() < 10 {
617 b = append(b, '0')
618 }
619
620 b = strconv.AppendInt(b, int64(t.Minute()), 10)
621 b = append(b, dz.timeSeparator...)
622
623 if t.Second() < 10 {
624 b = append(b, '0')
625 }
626
627 b = strconv.AppendInt(b, int64(t.Second()), 10)
628 b = append(b, []byte{0x20}...)
629
630 if t.Hour() < 12 {
631 b = append(b, dz.periodsAbbreviated[0]...)
632 } else {
633 b = append(b, dz.periodsAbbreviated[1]...)
634 }
635
636 b = append(b, []byte{0x20}...)
637
638 tz, _ := t.Zone()
639 b = append(b, tz...)
640
641 return string(b)
642 }
643
644
645 func (dz *dz_BT) FmtTimeFull(t time.Time) string {
646
647 b := make([]byte, 0, 32)
648
649 b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b, 0x20}...)
650
651 h := t.Hour()
652
653 if h > 12 {
654 h -= 12
655 }
656
657 b = strconv.AppendInt(b, int64(h), 10)
658 b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0x90, 0xe0, 0xbd, 0xa2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x98, 0xe0, 0xbc, 0x8b, 0x20}...)
659
660 if t.Minute() < 10 {
661 b = append(b, '0')
662 }
663
664 b = strconv.AppendInt(b, int64(t.Minute()), 10)
665 b = append(b, dz.timeSeparator...)
666
667 if t.Second() < 10 {
668 b = append(b, '0')
669 }
670
671 b = strconv.AppendInt(b, int64(t.Second()), 10)
672 b = append(b, []byte{0x20}...)
673
674 if t.Hour() < 12 {
675 b = append(b, dz.periodsAbbreviated[0]...)
676 } else {
677 b = append(b, dz.periodsAbbreviated[1]...)
678 }
679
680 b = append(b, []byte{0x20}...)
681
682 tz, _ := t.Zone()
683
684 if btz, ok := dz.timezones[tz]; ok {
685 b = append(b, btz...)
686 } else {
687 b = append(b, tz...)
688 }
689
690 return string(b)
691 }
692
View as plain text