ak_GH.go 17 KB

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