es_DO.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. package es_DO
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type es_DO 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. currencyPositiveSuffix string
  23. currencyNegativeSuffix string
  24. monthsAbbreviated []string
  25. monthsNarrow []string
  26. monthsWide []string
  27. daysAbbreviated []string
  28. daysNarrow []string
  29. daysShort []string
  30. daysWide []string
  31. periodsAbbreviated []string
  32. periodsNarrow []string
  33. periodsShort []string
  34. periodsWide []string
  35. erasAbbreviated []string
  36. erasNarrow []string
  37. erasWide []string
  38. timezones map[string]string
  39. }
  40. // New returns a new instance of translator for the 'es_DO' locale
  41. func New() locales.Translator {
  42. return &es_DO{
  43. locale: "es_DO",
  44. pluralsCardinal: []locales.PluralRule{2, 6},
  45. pluralsOrdinal: []locales.PluralRule{6},
  46. pluralsRange: []locales.PluralRule{6},
  47. decimal: ",",
  48. group: ".",
  49. minus: "-",
  50. percent: "%",
  51. perMille: "‰",
  52. timeSeparator: ":",
  53. inifinity: "∞",
  54. 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 ", "RD$", "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 ", "US$", "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 "},
  55. currencyPositiveSuffix: ")",
  56. currencyNegativeSuffix: ")",
  57. monthsAbbreviated: []string{"", "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sept.", "oct.", "nov.", "dic."},
  58. monthsNarrow: []string{"", "E", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
  59. monthsWide: []string{"", "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"},
  60. daysAbbreviated: []string{"dom.", "lun.", "mar.", "mié.", "jue.", "vie.", "sáb."},
  61. daysNarrow: []string{"D", "L", "M", "X", "J", "V", "S"},
  62. daysShort: []string{"DO", "LU", "MA", "MI", "JU", "VI", "SA"},
  63. daysWide: []string{"domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"},
  64. periodsAbbreviated: []string{"a. m.", "p. m."},
  65. periodsNarrow: []string{"", ""},
  66. periodsWide: []string{"a. m.", "p. m."},
  67. erasAbbreviated: []string{"", ""},
  68. erasNarrow: []string{"", ""},
  69. erasWide: []string{"antes de la Era Común", "Era Común"},
  70. timezones: map[string]string{"WAT": "hora estándar de África occidental", "BT": "hora de Bután", "HNT": "hora estándar de Terranova", "AEST": "hora estándar de Australia oriental", "SGT": "hora de Singapur", "HKT": "hora estándar de Hong Kong", "WITA": "hora de Indonesia central", "ACST": "hora estándar de Australia central", "CDT": "hora de verano central", "AST": "hora estándar del Atlántico", "MST": "Hora estándar de Macao", "AWST": "hora estándar de Australia occidental", "NZDT": "hora de verano de Nueva Zelanda", "CAT": "hora de África central", "∅∅∅": "Hora de verano de Acre", "PDT": "hora de verano del Pacífico", "NZST": "hora estándar de Nueva Zelanda", "UYST": "hora de verano de Uruguay", "CLT": "hora estándar de Chile", "EDT": "hora de verano oriental", "TMT": "hora estándar de Turkmenistán", "EST": "hora estándar oriental", "ADT": "hora de verano del Atlántico", "HADT": "hora de verano de Hawái-Aleutiano", "SAST": "hora de Sudáfrica", "ACDT": "hora de verano de Australia central", "SRT": "hora de Surinam", "BOT": "hora de Bolivia", "OESZ": "hora de verano de Europa oriental", "GFT": "hora de la Guayana Francesa", "ART": "hora estándar de Argentina", "CLST": "hora de verano de Chile", "WIB": "hora de Indonesia occidental", "PST": "hora estándar del Pacífico", "MESZ": "hora de verano de Europa central", "WAST": "hora de verano de África occidental", "WART": "hora estándar de Argentina occidental", "AWDT": "hora de verano de Australia occidental", "MEZ": "hora estándar de Europa central", "CHAST": "hora estándar de Chatham", "LHST": "hora estándar de Lord Howe", "UYT": "hora estándar de Uruguay", "COT": "hora estándar de Colombia", "HAST": "hora estándar de Hawái-Aleutiano", "WIT": "hora de Indonesia oriental", "TMST": "hora de verano de Turkmenistán", "GYT": "hora de Guyana", "ACWDT": "hora de verano de Australia centroccidental", "ECT": "hora de Ecuador", "CHADT": "hora de verano de Chatham", "IST": "hora estándar de la India", "AKST": "hora estándar de Alaska", "LHDT": "hora de verano de Lord Howe", "MYT": "hora de Malasia", "WEZ": "hora estándar de Europa occidental", "WESZ": "hora de verano de Europa occidental", "HKST": "hora de verano de Hong Kong", "HAT": "hora de verano de Terranova", "EAT": "hora de África oriental", "JDT": "hora de verano de Japón", "ACWST": "hora estándar de Australia centroccidental", "COST": "hora de verano de Colombia", "GMT": "hora del meridiano de Greenwich", "MDT": "Hora de verano de Macao", "ARST": "hora de verano de Argentina", "AKDT": "hora de verano de Alaska", "CST": "hora estándar central", "VET": "hora de Venezuela", "WARST": "hora de verano de Argentina occidental", "OEZ": "hora estándar de Europa oriental", "JST": "hora estándar de Japón", "AEDT": "hora de verano de Australia oriental", "ChST": "hora estándar de Chamorro"},
  71. }
  72. }
  73. // Locale returns the current translators string locale
  74. func (es *es_DO) Locale() string {
  75. return es.locale
  76. }
  77. // PluralsCardinal returns the list of cardinal plural rules associated with 'es_DO'
  78. func (es *es_DO) PluralsCardinal() []locales.PluralRule {
  79. return es.pluralsCardinal
  80. }
  81. // PluralsOrdinal returns the list of ordinal plural rules associated with 'es_DO'
  82. func (es *es_DO) PluralsOrdinal() []locales.PluralRule {
  83. return es.pluralsOrdinal
  84. }
  85. // PluralsRange returns the list of range plural rules associated with 'es_DO'
  86. func (es *es_DO) PluralsRange() []locales.PluralRule {
  87. return es.pluralsRange
  88. }
  89. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'es_DO'
  90. func (es *es_DO) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  91. n := math.Abs(num)
  92. if n == 1 {
  93. return locales.PluralRuleOne
  94. }
  95. return locales.PluralRuleOther
  96. }
  97. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'es_DO'
  98. func (es *es_DO) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  99. return locales.PluralRuleOther
  100. }
  101. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'es_DO'
  102. func (es *es_DO) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  103. return locales.PluralRuleOther
  104. }
  105. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  106. func (es *es_DO) MonthAbbreviated(month time.Month) string {
  107. return es.monthsAbbreviated[month]
  108. }
  109. // MonthsAbbreviated returns the locales abbreviated months
  110. func (es *es_DO) MonthsAbbreviated() []string {
  111. return es.monthsAbbreviated[1:]
  112. }
  113. // MonthNarrow returns the locales narrow month given the 'month' provided
  114. func (es *es_DO) MonthNarrow(month time.Month) string {
  115. return es.monthsNarrow[month]
  116. }
  117. // MonthsNarrow returns the locales narrow months
  118. func (es *es_DO) MonthsNarrow() []string {
  119. return es.monthsNarrow[1:]
  120. }
  121. // MonthWide returns the locales wide month given the 'month' provided
  122. func (es *es_DO) MonthWide(month time.Month) string {
  123. return es.monthsWide[month]
  124. }
  125. // MonthsWide returns the locales wide months
  126. func (es *es_DO) MonthsWide() []string {
  127. return es.monthsWide[1:]
  128. }
  129. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  130. func (es *es_DO) WeekdayAbbreviated(weekday time.Weekday) string {
  131. return es.daysAbbreviated[weekday]
  132. }
  133. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  134. func (es *es_DO) WeekdaysAbbreviated() []string {
  135. return es.daysAbbreviated
  136. }
  137. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  138. func (es *es_DO) WeekdayNarrow(weekday time.Weekday) string {
  139. return es.daysNarrow[weekday]
  140. }
  141. // WeekdaysNarrow returns the locales narrow weekdays
  142. func (es *es_DO) WeekdaysNarrow() []string {
  143. return es.daysNarrow
  144. }
  145. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  146. func (es *es_DO) WeekdayShort(weekday time.Weekday) string {
  147. return es.daysShort[weekday]
  148. }
  149. // WeekdaysShort returns the locales short weekdays
  150. func (es *es_DO) WeekdaysShort() []string {
  151. return es.daysShort
  152. }
  153. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  154. func (es *es_DO) WeekdayWide(weekday time.Weekday) string {
  155. return es.daysWide[weekday]
  156. }
  157. // WeekdaysWide returns the locales wide weekdays
  158. func (es *es_DO) WeekdaysWide() []string {
  159. return es.daysWide
  160. }
  161. // FmtNumber returns 'num' with digits/precision of 'v' for 'es_DO' and handles both Whole and Real numbers based on 'v'
  162. func (es *es_DO) FmtNumber(num float64, v uint64) string {
  163. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  164. l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
  165. count := 0
  166. inWhole := v == 0
  167. b := make([]byte, 0, l)
  168. for i := len(s) - 1; i >= 0; i-- {
  169. if s[i] == '.' {
  170. b = append(b, es.decimal[0])
  171. inWhole = true
  172. continue
  173. }
  174. if inWhole {
  175. if count == 3 {
  176. b = append(b, es.group[0])
  177. count = 1
  178. } else {
  179. count++
  180. }
  181. }
  182. b = append(b, s[i])
  183. }
  184. if num < 0 {
  185. b = append(b, es.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 'es_DO' 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 (es *es_DO) FmtPercent(num float64, v uint64) string {
  196. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  197. l := len(s) + 3
  198. b := make([]byte, 0, l)
  199. for i := len(s) - 1; i >= 0; i-- {
  200. if s[i] == '.' {
  201. b = append(b, es.decimal[0])
  202. continue
  203. }
  204. b = append(b, s[i])
  205. }
  206. if num < 0 {
  207. b = append(b, es.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, es.percent...)
  214. return string(b)
  215. }
  216. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'es_DO'
  217. func (es *es_DO) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  218. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  219. symbol := es.currencies[currency]
  220. l := len(s) + len(symbol) + 3 + 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, es.decimal[0])
  227. inWhole = true
  228. continue
  229. }
  230. if inWhole {
  231. if count == 3 {
  232. b = append(b, es.group[0])
  233. count = 1
  234. } else {
  235. count++
  236. }
  237. }
  238. b = append(b, s[i])
  239. }
  240. for j := len(symbol) - 1; j >= 0; j-- {
  241. b = append(b, symbol[j])
  242. }
  243. if num < 0 {
  244. b = append(b, es.minus[0])
  245. }
  246. // reverse
  247. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  248. b[i], b[j] = b[j], b[i]
  249. }
  250. if int(v) < 2 {
  251. if v == 0 {
  252. b = append(b, es.decimal...)
  253. }
  254. for i := 0; i < 2-int(v); i++ {
  255. b = append(b, '0')
  256. }
  257. }
  258. b = append(b, es.currencyPositiveSuffix...)
  259. return string(b)
  260. }
  261. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'es_DO'
  262. // in accounting notation.
  263. func (es *es_DO) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  264. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  265. symbol := es.currencies[currency]
  266. l := len(s) + len(symbol) + 3 + 1*len(s[:len(s)-int(v)-1])/3
  267. count := 0
  268. inWhole := v == 0
  269. b := make([]byte, 0, l)
  270. for i := len(s) - 1; i >= 0; i-- {
  271. if s[i] == '.' {
  272. b = append(b, es.decimal[0])
  273. inWhole = true
  274. continue
  275. }
  276. if inWhole {
  277. if count == 3 {
  278. b = append(b, es.group[0])
  279. count = 1
  280. } else {
  281. count++
  282. }
  283. }
  284. b = append(b, s[i])
  285. }
  286. if num < 0 {
  287. for j := len(symbol) - 1; j >= 0; j-- {
  288. b = append(b, symbol[j])
  289. }
  290. b = append(b, es.minus[0])
  291. } else {
  292. for j := len(symbol) - 1; j >= 0; j-- {
  293. b = append(b, symbol[j])
  294. }
  295. }
  296. // reverse
  297. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  298. b[i], b[j] = b[j], b[i]
  299. }
  300. if int(v) < 2 {
  301. if v == 0 {
  302. b = append(b, es.decimal...)
  303. }
  304. for i := 0; i < 2-int(v); i++ {
  305. b = append(b, '0')
  306. }
  307. }
  308. if num < 0 {
  309. b = append(b, es.currencyNegativeSuffix...)
  310. } else {
  311. b = append(b, es.currencyPositiveSuffix...)
  312. }
  313. return string(b)
  314. }
  315. // FmtDateShort returns the short date representation of 't' for 'es_DO'
  316. func (es *es_DO) FmtDateShort(t time.Time) string {
  317. b := make([]byte, 0, 32)
  318. b = strconv.AppendInt(b, int64(t.Day()), 10)
  319. b = append(b, []byte{0x2f}...)
  320. b = strconv.AppendInt(b, int64(t.Month()), 10)
  321. b = append(b, []byte{0x2f}...)
  322. if t.Year() > 9 {
  323. b = append(b, strconv.Itoa(t.Year())[2:]...)
  324. } else {
  325. b = append(b, strconv.Itoa(t.Year())[1:]...)
  326. }
  327. return string(b)
  328. }
  329. // FmtDateMedium returns the medium date representation of 't' for 'es_DO'
  330. func (es *es_DO) FmtDateMedium(t time.Time) string {
  331. b := make([]byte, 0, 32)
  332. b = strconv.AppendInt(b, int64(t.Day()), 10)
  333. b = append(b, []byte{0x20}...)
  334. b = append(b, es.monthsAbbreviated[t.Month()]...)
  335. b = append(b, []byte{0x20}...)
  336. b = strconv.AppendInt(b, int64(t.Year()), 10)
  337. return string(b)
  338. }
  339. // FmtDateLong returns the long date representation of 't' for 'es_DO'
  340. func (es *es_DO) FmtDateLong(t time.Time) string {
  341. b := make([]byte, 0, 32)
  342. b = strconv.AppendInt(b, int64(t.Day()), 10)
  343. b = append(b, []byte{}...)
  344. b = append(b, []byte{0x27, 0x64, 0x65, 0x27, 0x20}...)
  345. b = append(b, es.monthsWide[t.Month()]...)
  346. b = append(b, []byte{}...)
  347. b = append(b, []byte{0x27, 0x64, 0x65, 0x27, 0x20}...)
  348. b = strconv.AppendInt(b, int64(t.Year()), 10)
  349. return string(b)
  350. }
  351. // FmtDateFull returns the full date representation of 't' for 'es_DO'
  352. func (es *es_DO) FmtDateFull(t time.Time) string {
  353. b := make([]byte, 0, 32)
  354. b = append(b, es.daysWide[t.Weekday()]...)
  355. b = append(b, []byte{0x2c, 0x20}...)
  356. b = strconv.AppendInt(b, int64(t.Day()), 10)
  357. b = append(b, []byte{}...)
  358. b = append(b, []byte{0x27, 0x64, 0x65, 0x27, 0x20}...)
  359. b = append(b, es.monthsWide[t.Month()]...)
  360. b = append(b, []byte{}...)
  361. b = append(b, []byte{0x27, 0x64, 0x65, 0x27, 0x20}...)
  362. b = strconv.AppendInt(b, int64(t.Year()), 10)
  363. return string(b)
  364. }
  365. // FmtTimeShort returns the short time representation of 't' for 'es_DO'
  366. func (es *es_DO) FmtTimeShort(t time.Time) string {
  367. b := make([]byte, 0, 32)
  368. h := t.Hour()
  369. if h > 12 {
  370. h -= 12
  371. }
  372. b = strconv.AppendInt(b, int64(h), 10)
  373. b = append(b, es.timeSeparator...)
  374. if t.Minute() < 10 {
  375. b = append(b, '0')
  376. }
  377. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  378. b = append(b, []byte{0x20}...)
  379. if t.Hour() < 12 {
  380. b = append(b, es.periodsAbbreviated[0]...)
  381. } else {
  382. b = append(b, es.periodsAbbreviated[1]...)
  383. }
  384. return string(b)
  385. }
  386. // FmtTimeMedium returns the medium time representation of 't' for 'es_DO'
  387. func (es *es_DO) FmtTimeMedium(t time.Time) string {
  388. b := make([]byte, 0, 32)
  389. h := t.Hour()
  390. if h > 12 {
  391. h -= 12
  392. }
  393. b = strconv.AppendInt(b, int64(h), 10)
  394. b = append(b, es.timeSeparator...)
  395. if t.Minute() < 10 {
  396. b = append(b, '0')
  397. }
  398. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  399. b = append(b, es.timeSeparator...)
  400. if t.Second() < 10 {
  401. b = append(b, '0')
  402. }
  403. b = strconv.AppendInt(b, int64(t.Second()), 10)
  404. b = append(b, []byte{0x20}...)
  405. if t.Hour() < 12 {
  406. b = append(b, es.periodsAbbreviated[0]...)
  407. } else {
  408. b = append(b, es.periodsAbbreviated[1]...)
  409. }
  410. return string(b)
  411. }
  412. // FmtTimeLong returns the long time representation of 't' for 'es_DO'
  413. func (es *es_DO) FmtTimeLong(t time.Time) string {
  414. b := make([]byte, 0, 32)
  415. h := t.Hour()
  416. if h > 12 {
  417. h -= 12
  418. }
  419. b = strconv.AppendInt(b, int64(h), 10)
  420. b = append(b, es.timeSeparator...)
  421. if t.Minute() < 10 {
  422. b = append(b, '0')
  423. }
  424. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  425. b = append(b, es.timeSeparator...)
  426. if t.Second() < 10 {
  427. b = append(b, '0')
  428. }
  429. b = strconv.AppendInt(b, int64(t.Second()), 10)
  430. b = append(b, []byte{0x20}...)
  431. if t.Hour() < 12 {
  432. b = append(b, es.periodsAbbreviated[0]...)
  433. } else {
  434. b = append(b, es.periodsAbbreviated[1]...)
  435. }
  436. b = append(b, []byte{0x20}...)
  437. tz, _ := t.Zone()
  438. b = append(b, tz...)
  439. return string(b)
  440. }
  441. // FmtTimeFull returns the full time representation of 't' for 'es_DO'
  442. func (es *es_DO) FmtTimeFull(t time.Time) string {
  443. b := make([]byte, 0, 32)
  444. h := t.Hour()
  445. if h > 12 {
  446. h -= 12
  447. }
  448. b = strconv.AppendInt(b, int64(h), 10)
  449. b = append(b, es.timeSeparator...)
  450. if t.Minute() < 10 {
  451. b = append(b, '0')
  452. }
  453. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  454. b = append(b, es.timeSeparator...)
  455. if t.Second() < 10 {
  456. b = append(b, '0')
  457. }
  458. b = strconv.AppendInt(b, int64(t.Second()), 10)
  459. b = append(b, []byte{0x20}...)
  460. if t.Hour() < 12 {
  461. b = append(b, es.periodsAbbreviated[0]...)
  462. } else {
  463. b = append(b, es.periodsAbbreviated[1]...)
  464. }
  465. b = append(b, []byte{0x20}...)
  466. tz, _ := t.Zone()
  467. if btz, ok := es.timezones[tz]; ok {
  468. b = append(b, btz...)
  469. } else {
  470. b = append(b, tz...)
  471. }
  472. return string(b)
  473. }