bas_CM.go 17 KB

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