twq_NE.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. package twq_NE
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type twq_NE struct {
  10. locale string
  11. pluralsCardinal []locales.PluralRule
  12. pluralsOrdinal []locales.PluralRule
  13. pluralsRange []locales.PluralRule
  14. decimal string
  15. group string
  16. minus string
  17. percent string
  18. perMille string
  19. timeSeparator string
  20. inifinity string
  21. currencies []string // idx = enum of currency code
  22. monthsAbbreviated []string
  23. monthsNarrow []string
  24. monthsWide []string
  25. daysAbbreviated []string
  26. daysNarrow []string
  27. daysShort []string
  28. daysWide []string
  29. periodsAbbreviated []string
  30. periodsNarrow []string
  31. periodsShort []string
  32. periodsWide []string
  33. erasAbbreviated []string
  34. erasNarrow []string
  35. erasWide []string
  36. timezones map[string]string
  37. }
  38. // New returns a new instance of translator for the 'twq_NE' locale
  39. func New() locales.Translator {
  40. return &twq_NE{
  41. locale: "twq_NE",
  42. pluralsCardinal: nil,
  43. pluralsOrdinal: nil,
  44. pluralsRange: nil,
  45. decimal: ".",
  46. group: " ",
  47. timeSeparator: ":",
  48. 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", "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", "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"},
  49. monthsAbbreviated: []string{"", "Žan", "Fee", "Mar", "Awi", "Me", "Žuw", "Žuy", "Ut", "Sek", "Okt", "Noo", "Dee"},
  50. monthsNarrow: []string{"", "Ž", "F", "M", "A", "M", "Ž", "Ž", "U", "S", "O", "N", "D"},
  51. monthsWide: []string{"", "Žanwiye", "Feewiriye", "Marsi", "Awiril", "Me", "Žuweŋ", "Žuyye", "Ut", "Sektanbur", "Oktoobur", "Noowanbur", "Deesanbur"},
  52. daysAbbreviated: []string{"Alh", "Ati", "Ata", "Ala", "Alm", "Alz", "Asi"},
  53. daysNarrow: []string{"H", "T", "T", "L", "L", "L", "S"},
  54. daysWide: []string{"Alhadi", "Atinni", "Atalaata", "Alarba", "Alhamiisa", "Alzuma", "Asibti"},
  55. periodsAbbreviated: []string{"Subbaahi", "Zaarikay b"},
  56. periodsWide: []string{"Subbaahi", "Zaarikay b"},
  57. erasAbbreviated: []string{"IJ", "IZ"},
  58. erasNarrow: []string{"", ""},
  59. erasWide: []string{"Isaa jine", "Isaa zamanoo"},
  60. timezones: map[string]string{"CLT": "CLT", "CHAST": "CHAST", "HECU": "HECU", "BOT": "BOT", "ACWST": "ACWST", "IST": "IST", "ADT": "ADT", "ECT": "ECT", "GYT": "GYT", "WIB": "WIB", "HNOG": "HNOG", "EAT": "EAT", "HAST": "HAST", "ACDT": "ACDT", "MESZ": "MESZ", "VET": "VET", "∅∅∅": "∅∅∅", "MST": "MST", "WESZ": "WESZ", "GFT": "GFT", "JST": "JST", "HEPM": "HEPM", "HNNOMX": "HNNOMX", "HNPMX": "HNPMX", "MEZ": "MEZ", "LHST": "LHST", "HNT": "HNT", "HNPM": "HNPM", "GMT": "GMT", "UYT": "UYT", "AWDT": "AWDT", "AST": "AST", "WAST": "WAST", "NZDT": "NZDT", "AKST": "AKST", "SAST": "SAST", "WEZ": "WEZ", "MYT": "MYT", "PST": "PST", "WAT": "WAT", "HEOG": "HEOG", "TMT": "TMT", "TMST": "TMST", "CLST": "CLST", "COT": "COT", "HEPMX": "HEPMX", "CDT": "CDT", "PDT": "PDT", "HEEG": "HEEG", "WITA": "WITA", "ChST": "ChST", "CHADT": "CHADT", "NZST": "NZST", "EST": "EST", "UYST": "UYST", "AWST": "AWST", "MDT": "MDT", "LHDT": "LHDT", "WARST": "WARST", "HADT": "HADT", "HNCU": "HNCU", "CST": "CST", "SGT": "SGT", "EDT": "EDT", "ACST": "ACST", "AEDT": "AEDT", "HKT": "HKT", "WIT": "WIT", "CAT": "CAT", "ART": "ART", "ACWDT": "ACWDT", "HAT": "HAT", "HENOMX": "HENOMX", "SRT": "SRT", "COST": "COST", "AEST": "AEST", "AKDT": "AKDT", "HNEG": "HNEG", "HKST": "HKST", "WART": "WART", "JDT": "JDT", "BT": "BT", "OEZ": "OEZ", "OESZ": "OESZ", "ARST": "ARST"},
  61. }
  62. }
  63. // Locale returns the current translators string locale
  64. func (twq *twq_NE) Locale() string {
  65. return twq.locale
  66. }
  67. // PluralsCardinal returns the list of cardinal plural rules associated with 'twq_NE'
  68. func (twq *twq_NE) PluralsCardinal() []locales.PluralRule {
  69. return twq.pluralsCardinal
  70. }
  71. // PluralsOrdinal returns the list of ordinal plural rules associated with 'twq_NE'
  72. func (twq *twq_NE) PluralsOrdinal() []locales.PluralRule {
  73. return twq.pluralsOrdinal
  74. }
  75. // PluralsRange returns the list of range plural rules associated with 'twq_NE'
  76. func (twq *twq_NE) PluralsRange() []locales.PluralRule {
  77. return twq.pluralsRange
  78. }
  79. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'twq_NE'
  80. func (twq *twq_NE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  81. return locales.PluralRuleUnknown
  82. }
  83. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'twq_NE'
  84. func (twq *twq_NE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  85. return locales.PluralRuleUnknown
  86. }
  87. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'twq_NE'
  88. func (twq *twq_NE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  89. return locales.PluralRuleUnknown
  90. }
  91. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  92. func (twq *twq_NE) MonthAbbreviated(month time.Month) string {
  93. return twq.monthsAbbreviated[month]
  94. }
  95. // MonthsAbbreviated returns the locales abbreviated months
  96. func (twq *twq_NE) MonthsAbbreviated() []string {
  97. return twq.monthsAbbreviated[1:]
  98. }
  99. // MonthNarrow returns the locales narrow month given the 'month' provided
  100. func (twq *twq_NE) MonthNarrow(month time.Month) string {
  101. return twq.monthsNarrow[month]
  102. }
  103. // MonthsNarrow returns the locales narrow months
  104. func (twq *twq_NE) MonthsNarrow() []string {
  105. return twq.monthsNarrow[1:]
  106. }
  107. // MonthWide returns the locales wide month given the 'month' provided
  108. func (twq *twq_NE) MonthWide(month time.Month) string {
  109. return twq.monthsWide[month]
  110. }
  111. // MonthsWide returns the locales wide months
  112. func (twq *twq_NE) MonthsWide() []string {
  113. return twq.monthsWide[1:]
  114. }
  115. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  116. func (twq *twq_NE) WeekdayAbbreviated(weekday time.Weekday) string {
  117. return twq.daysAbbreviated[weekday]
  118. }
  119. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  120. func (twq *twq_NE) WeekdaysAbbreviated() []string {
  121. return twq.daysAbbreviated
  122. }
  123. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  124. func (twq *twq_NE) WeekdayNarrow(weekday time.Weekday) string {
  125. return twq.daysNarrow[weekday]
  126. }
  127. // WeekdaysNarrow returns the locales narrow weekdays
  128. func (twq *twq_NE) WeekdaysNarrow() []string {
  129. return twq.daysNarrow
  130. }
  131. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  132. func (twq *twq_NE) WeekdayShort(weekday time.Weekday) string {
  133. return twq.daysShort[weekday]
  134. }
  135. // WeekdaysShort returns the locales short weekdays
  136. func (twq *twq_NE) WeekdaysShort() []string {
  137. return twq.daysShort
  138. }
  139. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  140. func (twq *twq_NE) WeekdayWide(weekday time.Weekday) string {
  141. return twq.daysWide[weekday]
  142. }
  143. // WeekdaysWide returns the locales wide weekdays
  144. func (twq *twq_NE) WeekdaysWide() []string {
  145. return twq.daysWide
  146. }
  147. // Decimal returns the decimal point of number
  148. func (twq *twq_NE) Decimal() string {
  149. return twq.decimal
  150. }
  151. // Group returns the group of number
  152. func (twq *twq_NE) Group() string {
  153. return twq.group
  154. }
  155. // Group returns the minus sign of number
  156. func (twq *twq_NE) Minus() string {
  157. return twq.minus
  158. }
  159. // FmtNumber returns 'num' with digits/precision of 'v' for 'twq_NE' and handles both Whole and Real numbers based on 'v'
  160. func (twq *twq_NE) FmtNumber(num float64, v uint64) string {
  161. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  162. l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
  163. count := 0
  164. inWhole := v == 0
  165. b := make([]byte, 0, l)
  166. for i := len(s) - 1; i >= 0; i-- {
  167. if s[i] == '.' {
  168. b = append(b, twq.decimal[0])
  169. inWhole = true
  170. continue
  171. }
  172. if inWhole {
  173. if count == 3 {
  174. for j := len(twq.group) - 1; j >= 0; j-- {
  175. b = append(b, twq.group[j])
  176. }
  177. count = 1
  178. } else {
  179. count++
  180. }
  181. }
  182. b = append(b, s[i])
  183. }
  184. if num < 0 {
  185. b = append(b, twq.minus[0])
  186. }
  187. // reverse
  188. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  189. b[i], b[j] = b[j], b[i]
  190. }
  191. return string(b)
  192. }
  193. // FmtPercent returns 'num' with digits/precision of 'v' for 'twq_NE' and handles both Whole and Real numbers based on 'v'
  194. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  195. func (twq *twq_NE) FmtPercent(num float64, v uint64) string {
  196. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  197. l := len(s) + 1
  198. b := make([]byte, 0, l)
  199. for i := len(s) - 1; i >= 0; i-- {
  200. if s[i] == '.' {
  201. b = append(b, twq.decimal[0])
  202. continue
  203. }
  204. b = append(b, s[i])
  205. }
  206. if num < 0 {
  207. b = append(b, twq.minus[0])
  208. }
  209. // reverse
  210. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  211. b[i], b[j] = b[j], b[i]
  212. }
  213. b = append(b, twq.percent...)
  214. return string(b)
  215. }
  216. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'twq_NE'
  217. func (twq *twq_NE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  218. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  219. symbol := twq.currencies[currency]
  220. l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
  221. count := 0
  222. inWhole := v == 0
  223. b := make([]byte, 0, l)
  224. for i := len(s) - 1; i >= 0; i-- {
  225. if s[i] == '.' {
  226. b = append(b, twq.decimal[0])
  227. inWhole = true
  228. continue
  229. }
  230. if inWhole {
  231. if count == 3 {
  232. for j := len(twq.group) - 1; j >= 0; j-- {
  233. b = append(b, twq.group[j])
  234. }
  235. count = 1
  236. } else {
  237. count++
  238. }
  239. }
  240. b = append(b, s[i])
  241. }
  242. if num < 0 {
  243. b = append(b, twq.minus[0])
  244. }
  245. // reverse
  246. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  247. b[i], b[j] = b[j], b[i]
  248. }
  249. if int(v) < 2 {
  250. if v == 0 {
  251. b = append(b, twq.decimal...)
  252. }
  253. for i := 0; i < 2-int(v); i++ {
  254. b = append(b, '0')
  255. }
  256. }
  257. b = append(b, symbol...)
  258. return string(b)
  259. }
  260. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'twq_NE'
  261. // in accounting notation.
  262. func (twq *twq_NE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  263. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  264. symbol := twq.currencies[currency]
  265. l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
  266. count := 0
  267. inWhole := v == 0
  268. b := make([]byte, 0, l)
  269. for i := len(s) - 1; i >= 0; i-- {
  270. if s[i] == '.' {
  271. b = append(b, twq.decimal[0])
  272. inWhole = true
  273. continue
  274. }
  275. if inWhole {
  276. if count == 3 {
  277. for j := len(twq.group) - 1; j >= 0; j-- {
  278. b = append(b, twq.group[j])
  279. }
  280. count = 1
  281. } else {
  282. count++
  283. }
  284. }
  285. b = append(b, s[i])
  286. }
  287. if num < 0 {
  288. b = append(b, twq.minus[0])
  289. }
  290. // reverse
  291. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  292. b[i], b[j] = b[j], b[i]
  293. }
  294. if int(v) < 2 {
  295. if v == 0 {
  296. b = append(b, twq.decimal...)
  297. }
  298. for i := 0; i < 2-int(v); i++ {
  299. b = append(b, '0')
  300. }
  301. }
  302. if num < 0 {
  303. b = append(b, symbol...)
  304. } else {
  305. b = append(b, symbol...)
  306. }
  307. return string(b)
  308. }
  309. // FmtDateShort returns the short date representation of 't' for 'twq_NE'
  310. func (twq *twq_NE) FmtDateShort(t time.Time) string {
  311. b := make([]byte, 0, 32)
  312. b = strconv.AppendInt(b, int64(t.Day()), 10)
  313. b = append(b, []byte{0x2f}...)
  314. b = strconv.AppendInt(b, int64(t.Month()), 10)
  315. b = append(b, []byte{0x2f}...)
  316. if t.Year() > 0 {
  317. b = strconv.AppendInt(b, int64(t.Year()), 10)
  318. } else {
  319. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  320. }
  321. return string(b)
  322. }
  323. // FmtDateMedium returns the medium date representation of 't' for 'twq_NE'
  324. func (twq *twq_NE) FmtDateMedium(t time.Time) string {
  325. b := make([]byte, 0, 32)
  326. b = strconv.AppendInt(b, int64(t.Day()), 10)
  327. b = append(b, []byte{0x20}...)
  328. b = append(b, twq.monthsAbbreviated[t.Month()]...)
  329. b = append(b, []byte{0x20}...)
  330. if t.Year() > 0 {
  331. b = strconv.AppendInt(b, int64(t.Year()), 10)
  332. } else {
  333. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  334. }
  335. return string(b)
  336. }
  337. // FmtDateLong returns the long date representation of 't' for 'twq_NE'
  338. func (twq *twq_NE) FmtDateLong(t time.Time) string {
  339. b := make([]byte, 0, 32)
  340. b = strconv.AppendInt(b, int64(t.Day()), 10)
  341. b = append(b, []byte{0x20}...)
  342. b = append(b, twq.monthsWide[t.Month()]...)
  343. b = append(b, []byte{0x20}...)
  344. if t.Year() > 0 {
  345. b = strconv.AppendInt(b, int64(t.Year()), 10)
  346. } else {
  347. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  348. }
  349. return string(b)
  350. }
  351. // FmtDateFull returns the full date representation of 't' for 'twq_NE'
  352. func (twq *twq_NE) FmtDateFull(t time.Time) string {
  353. b := make([]byte, 0, 32)
  354. b = append(b, twq.daysWide[t.Weekday()]...)
  355. b = append(b, []byte{0x20}...)
  356. b = strconv.AppendInt(b, int64(t.Day()), 10)
  357. b = append(b, []byte{0x20}...)
  358. b = append(b, twq.monthsWide[t.Month()]...)
  359. b = append(b, []byte{0x20}...)
  360. if t.Year() > 0 {
  361. b = strconv.AppendInt(b, int64(t.Year()), 10)
  362. } else {
  363. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  364. }
  365. return string(b)
  366. }
  367. // FmtTimeShort returns the short time representation of 't' for 'twq_NE'
  368. func (twq *twq_NE) FmtTimeShort(t time.Time) string {
  369. b := make([]byte, 0, 32)
  370. if t.Hour() < 10 {
  371. b = append(b, '0')
  372. }
  373. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  374. b = append(b, twq.timeSeparator...)
  375. if t.Minute() < 10 {
  376. b = append(b, '0')
  377. }
  378. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  379. return string(b)
  380. }
  381. // FmtTimeMedium returns the medium time representation of 't' for 'twq_NE'
  382. func (twq *twq_NE) FmtTimeMedium(t time.Time) string {
  383. b := make([]byte, 0, 32)
  384. if t.Hour() < 10 {
  385. b = append(b, '0')
  386. }
  387. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  388. b = append(b, twq.timeSeparator...)
  389. if t.Minute() < 10 {
  390. b = append(b, '0')
  391. }
  392. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  393. b = append(b, twq.timeSeparator...)
  394. if t.Second() < 10 {
  395. b = append(b, '0')
  396. }
  397. b = strconv.AppendInt(b, int64(t.Second()), 10)
  398. return string(b)
  399. }
  400. // FmtTimeLong returns the long time representation of 't' for 'twq_NE'
  401. func (twq *twq_NE) FmtTimeLong(t time.Time) string {
  402. b := make([]byte, 0, 32)
  403. if t.Hour() < 10 {
  404. b = append(b, '0')
  405. }
  406. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  407. b = append(b, twq.timeSeparator...)
  408. if t.Minute() < 10 {
  409. b = append(b, '0')
  410. }
  411. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  412. b = append(b, twq.timeSeparator...)
  413. if t.Second() < 10 {
  414. b = append(b, '0')
  415. }
  416. b = strconv.AppendInt(b, int64(t.Second()), 10)
  417. b = append(b, []byte{0x20}...)
  418. tz, _ := t.Zone()
  419. b = append(b, tz...)
  420. return string(b)
  421. }
  422. // FmtTimeFull returns the full time representation of 't' for 'twq_NE'
  423. func (twq *twq_NE) FmtTimeFull(t time.Time) string {
  424. b := make([]byte, 0, 32)
  425. if t.Hour() < 10 {
  426. b = append(b, '0')
  427. }
  428. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  429. b = append(b, twq.timeSeparator...)
  430. if t.Minute() < 10 {
  431. b = append(b, '0')
  432. }
  433. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  434. b = append(b, twq.timeSeparator...)
  435. if t.Second() < 10 {
  436. b = append(b, '0')
  437. }
  438. b = strconv.AppendInt(b, int64(t.Second()), 10)
  439. b = append(b, []byte{0x20}...)
  440. tz, _ := t.Zone()
  441. if btz, ok := twq.timezones[tz]; ok {
  442. b = append(b, btz...)
  443. } else {
  444. b = append(b, tz...)
  445. }
  446. return string(b)
  447. }