javascript-time-ago 2.5.11 โ†’ 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/README.md +410 -272
  3. package/bundle/javascript-time-ago.js +1 -1
  4. package/bundle/javascript-time-ago.js.map +1 -1
  5. package/bundle/javascript-time-ago.min.js +1 -1
  6. package/bundle/javascript-time-ago.min.js.map +1 -1
  7. package/commonjs/FullDateFormatter.js +72 -0
  8. package/commonjs/FullDateFormatter.js.map +1 -0
  9. package/commonjs/FullDateFormatter.test.js +26 -0
  10. package/commonjs/FullDateFormatter.test.js.map +1 -0
  11. package/commonjs/LocaleDataStore.js +2 -5
  12. package/commonjs/LocaleDataStore.js.map +1 -1
  13. package/commonjs/PropTypes.js +12 -12
  14. package/commonjs/PropTypes.js.map +1 -1
  15. package/commonjs/TimeAgo.js +300 -253
  16. package/commonjs/TimeAgo.js.map +1 -1
  17. package/commonjs/TimeAgo.test.js +214 -135
  18. package/commonjs/TimeAgo.test.js.map +1 -1
  19. package/commonjs/cache.js +7 -25
  20. package/commonjs/cache.js.map +1 -1
  21. package/commonjs/cache.test.js +1 -3
  22. package/commonjs/cache.test.js.map +1 -1
  23. package/commonjs/isStyleObject.js +9 -9
  24. package/commonjs/isStyleObject.js.map +1 -1
  25. package/commonjs/isStyleObject.test.js +1 -3
  26. package/commonjs/isStyleObject.test.js.map +1 -1
  27. package/commonjs/locale.js +6 -19
  28. package/commonjs/locale.js.map +1 -1
  29. package/commonjs/locale.test.js +2 -11
  30. package/commonjs/locale.test.js.map +1 -1
  31. package/commonjs/round.js +2 -5
  32. package/commonjs/round.js.map +1 -1
  33. package/commonjs/steps/approximate.js +1 -4
  34. package/commonjs/steps/approximate.js.map +1 -1
  35. package/commonjs/steps/approximate.test.js +1 -6
  36. package/commonjs/steps/approximate.test.js.map +1 -1
  37. package/commonjs/steps/getStep.js +36 -53
  38. package/commonjs/steps/getStep.js.map +1 -1
  39. package/commonjs/steps/getStep.test.js +7 -7
  40. package/commonjs/steps/getStep.test.js.map +1 -1
  41. package/commonjs/steps/getStepDenominator.js +2 -5
  42. package/commonjs/steps/getStepDenominator.js.map +1 -1
  43. package/commonjs/steps/getStepDenominator.test.js +1 -3
  44. package/commonjs/steps/getStepDenominator.test.js.map +1 -1
  45. package/commonjs/steps/getStepMinTime.js +31 -39
  46. package/commonjs/steps/getStepMinTime.js.map +1 -1
  47. package/commonjs/steps/getStepMinTime.test.js +1 -3
  48. package/commonjs/steps/getStepMinTime.test.js.map +1 -1
  49. package/commonjs/steps/getTimeToNextUpdate.js +27 -41
  50. package/commonjs/steps/getTimeToNextUpdate.js.map +1 -1
  51. package/commonjs/steps/getTimeToNextUpdate.test.js +29 -25
  52. package/commonjs/steps/getTimeToNextUpdate.test.js.map +1 -1
  53. package/commonjs/steps/getTimeToNextUpdateForUnit.js +3 -12
  54. package/commonjs/steps/getTimeToNextUpdateForUnit.js.map +1 -1
  55. package/commonjs/steps/getTimeToNextUpdateForUnit.test.js +1 -7
  56. package/commonjs/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
  57. package/commonjs/steps/helpers.js +1 -2
  58. package/commonjs/steps/helpers.js.map +1 -1
  59. package/commonjs/steps/helpers.test.js +0 -1
  60. package/commonjs/steps/helpers.test.js.map +1 -1
  61. package/commonjs/steps/index.js +1 -6
  62. package/commonjs/steps/index.js.map +1 -1
  63. package/commonjs/steps/renameLegacyProperties.js +6 -14
  64. package/commonjs/steps/renameLegacyProperties.js.map +1 -1
  65. package/commonjs/steps/renameLegacyProperties.test.js +1 -3
  66. package/commonjs/steps/renameLegacyProperties.test.js.map +1 -1
  67. package/commonjs/steps/round.js +1 -2
  68. package/commonjs/steps/round.js.map +1 -1
  69. package/commonjs/steps/round.test.js +1 -7
  70. package/commonjs/steps/round.test.js.map +1 -1
  71. package/commonjs/steps/units.js +10 -21
  72. package/commonjs/steps/units.js.map +1 -1
  73. package/commonjs/style/approximate.js +2 -6
  74. package/commonjs/style/approximate.js.map +1 -1
  75. package/commonjs/style/approximateTime.js +2 -6
  76. package/commonjs/style/approximateTime.js.map +1 -1
  77. package/commonjs/style/approximateTime.test.js +116 -75
  78. package/commonjs/style/approximateTime.test.js.map +1 -1
  79. package/commonjs/style/getStyleByName.js +3 -29
  80. package/commonjs/style/getStyleByName.js.map +1 -1
  81. package/commonjs/style/mini.js +9 -6
  82. package/commonjs/style/mini.js.map +1 -1
  83. package/commonjs/style/mini.test.js +15 -25
  84. package/commonjs/style/mini.test.js.map +1 -1
  85. package/commonjs/style/miniMinute.js +8 -13
  86. package/commonjs/style/miniMinute.js.map +1 -1
  87. package/commonjs/style/miniMinute.test.js +11 -17
  88. package/commonjs/style/miniMinute.test.js.map +1 -1
  89. package/commonjs/style/miniMinuteNow.js +8 -13
  90. package/commonjs/style/miniMinuteNow.js.map +1 -1
  91. package/commonjs/style/miniMinuteNow.test.js +11 -17
  92. package/commonjs/style/miniMinuteNow.test.js.map +1 -1
  93. package/commonjs/style/miniNow.js +8 -13
  94. package/commonjs/style/miniNow.js.map +1 -1
  95. package/commonjs/style/miniNow.test.js +11 -17
  96. package/commonjs/style/miniNow.test.js.map +1 -1
  97. package/commonjs/style/renameLegacyProperties.js +7 -13
  98. package/commonjs/style/renameLegacyProperties.js.map +1 -1
  99. package/commonjs/style/renameLegacyProperties.test.js +1 -4
  100. package/commonjs/style/renameLegacyProperties.test.js.map +1 -1
  101. package/commonjs/style/round.js +2 -6
  102. package/commonjs/style/round.js.map +1 -1
  103. package/commonjs/style/round.test.js +51 -67
  104. package/commonjs/style/round.test.js.map +1 -1
  105. package/commonjs/style/roundMinute.js +8 -13
  106. package/commonjs/style/roundMinute.js.map +1 -1
  107. package/commonjs/style/roundMinute.test.js +20 -27
  108. package/commonjs/style/roundMinute.test.js.map +1 -1
  109. package/commonjs/style/twitter.js +34 -39
  110. package/commonjs/style/twitter.js.map +1 -1
  111. package/commonjs/style/twitter.test.js +54 -57
  112. package/commonjs/style/twitter.test.js.map +1 -1
  113. package/commonjs/style/twitterFirstMinute.js +10 -15
  114. package/commonjs/style/twitterFirstMinute.js.map +1 -1
  115. package/commonjs/style/twitterFirstMinute.test.js +16 -23
  116. package/commonjs/style/twitterFirstMinute.test.js.map +1 -1
  117. package/commonjs/style/twitterMinute.js +8 -13
  118. package/commonjs/style/twitterMinute.js.map +1 -1
  119. package/commonjs/style/twitterMinute.test.js +20 -25
  120. package/commonjs/style/twitterMinute.test.js.map +1 -1
  121. package/commonjs/style/twitterMinuteNow.js +8 -13
  122. package/commonjs/style/twitterMinuteNow.js.map +1 -1
  123. package/commonjs/style/twitterMinuteNow.test.js +20 -25
  124. package/commonjs/style/twitterMinuteNow.test.js.map +1 -1
  125. package/commonjs/style/twitterNow.js +8 -13
  126. package/commonjs/style/twitterNow.js.map +1 -1
  127. package/commonjs/style/twitterNow.test.js +18 -24
  128. package/commonjs/style/twitterNow.test.js.map +1 -1
  129. package/full-date-formatter/index.cjs +4 -0
  130. package/full-date-formatter/index.cjs.js +9 -0
  131. package/full-date-formatter/index.d.ts +6 -0
  132. package/full-date-formatter/index.js +1 -0
  133. package/full-date-formatter/package.json +15 -0
  134. package/index.cjs +1 -1
  135. package/index.cjs.js +2 -2
  136. package/index.d.ts +14 -4
  137. package/index.js +3 -1
  138. package/load-all-locales/index.cjs +32 -0
  139. package/load-all-locales/index.cjs.js +32 -0
  140. package/load-all-locales/index.js +64 -0
  141. package/locale/ak/package.json +16 -0
  142. package/locale/ak.json +267 -0
  143. package/locale/ak.json.d.ts +4 -0
  144. package/locale/ak.json.js +267 -0
  145. package/locale/bal-Latn/package.json +16 -0
  146. package/locale/bal-Latn.json +240 -0
  147. package/locale/bal-Latn.json.d.ts +4 -0
  148. package/locale/bal-Latn.json.js +240 -0
  149. package/locale/be-tarask/package.json +16 -0
  150. package/locale/be-tarask.json +259 -0
  151. package/locale/be-tarask.json.d.ts +4 -0
  152. package/locale/be-tarask.json.js +259 -0
  153. package/locale/blo/package.json +16 -0
  154. package/locale/blo.json +159 -0
  155. package/locale/blo.json.d.ts +4 -0
  156. package/locale/blo.json.js +159 -0
  157. package/locale/bn.json +5 -2
  158. package/locale/bn.json.js +5 -2
  159. package/locale/bs.json +8 -2
  160. package/locale/bs.json.js +8 -2
  161. package/locale/ccp.json +2 -8
  162. package/locale/ccp.json.js +2 -8
  163. package/locale/csw/package.json +16 -0
  164. package/locale/csw.json +180 -0
  165. package/locale/csw.json.d.ts +4 -0
  166. package/locale/csw.json.js +180 -0
  167. package/locale/cy.json +6 -12
  168. package/locale/cy.json.js +6 -12
  169. package/locale/doi/package.json +16 -0
  170. package/locale/doi.json +159 -0
  171. package/locale/doi.json.d.ts +4 -0
  172. package/locale/doi.json.js +159 -0
  173. package/locale/en-AU.json +12 -12
  174. package/locale/en-AU.json.js +12 -12
  175. package/locale/en-CZ/package.json +16 -0
  176. package/locale/en-CZ.json +219 -0
  177. package/locale/en-CZ.json.d.ts +4 -0
  178. package/locale/en-CZ.json.js +219 -0
  179. package/locale/en-ES/package.json +16 -0
  180. package/locale/en-ES.json +219 -0
  181. package/locale/en-ES.json.d.ts +4 -0
  182. package/locale/en-ES.json.js +219 -0
  183. package/locale/en-FR/package.json +16 -0
  184. package/locale/en-FR.json +219 -0
  185. package/locale/en-FR.json.d.ts +4 -0
  186. package/locale/en-FR.json.js +219 -0
  187. package/locale/en-GS/package.json +16 -0
  188. package/locale/en-GS.json +219 -0
  189. package/locale/en-GS.json.d.ts +4 -0
  190. package/locale/en-GS.json.js +219 -0
  191. package/locale/en-HU/package.json +16 -0
  192. package/locale/en-HU.json +219 -0
  193. package/locale/en-HU.json.d.ts +4 -0
  194. package/locale/en-HU.json.js +219 -0
  195. package/locale/en-ID/package.json +16 -0
  196. package/locale/en-ID.json +219 -0
  197. package/locale/en-ID.json.d.ts +4 -0
  198. package/locale/en-ID.json.js +219 -0
  199. package/locale/en-IT/package.json +16 -0
  200. package/locale/en-IT.json +219 -0
  201. package/locale/en-IT.json.d.ts +4 -0
  202. package/locale/en-IT.json.js +219 -0
  203. package/locale/en-NO/package.json +16 -0
  204. package/locale/en-NO.json +219 -0
  205. package/locale/en-NO.json.d.ts +4 -0
  206. package/locale/en-NO.json.js +219 -0
  207. package/locale/en-PL/package.json +16 -0
  208. package/locale/en-PL.json +219 -0
  209. package/locale/en-PL.json.d.ts +4 -0
  210. package/locale/en-PL.json.js +219 -0
  211. package/locale/en-PT/package.json +16 -0
  212. package/locale/en-PT.json +219 -0
  213. package/locale/en-PT.json.d.ts +4 -0
  214. package/locale/en-PT.json.js +219 -0
  215. package/locale/en-RO/package.json +16 -0
  216. package/locale/en-RO.json +219 -0
  217. package/locale/en-RO.json.d.ts +4 -0
  218. package/locale/en-RO.json.js +219 -0
  219. package/locale/en-SK/package.json +16 -0
  220. package/locale/en-SK.json +219 -0
  221. package/locale/en-SK.json.d.ts +4 -0
  222. package/locale/en-SK.json.js +219 -0
  223. package/locale/es-MX.json +12 -9
  224. package/locale/es-MX.json.js +12 -9
  225. package/locale/es-SV.json +2 -2
  226. package/locale/es-SV.json.js +2 -2
  227. package/locale/eu.json +24 -24
  228. package/locale/eu.json.js +24 -24
  229. package/locale/ha.json +119 -65
  230. package/locale/ha.json.js +119 -65
  231. package/locale/he.json +0 -6
  232. package/locale/he.json.js +0 -6
  233. package/locale/hi-Latn.json +2 -2
  234. package/locale/hi-Latn.json.js +2 -2
  235. package/locale/ht/package.json +16 -0
  236. package/locale/ht.json +207 -0
  237. package/locale/ht.json.d.ts +4 -0
  238. package/locale/ht.json.js +207 -0
  239. package/locale/id.json +1 -1
  240. package/locale/id.json.js +1 -1
  241. package/locale/ie/package.json +16 -0
  242. package/locale/ie.json +159 -0
  243. package/locale/ie.json.d.ts +4 -0
  244. package/locale/ie.json.js +159 -0
  245. package/locale/ig.json +17 -17
  246. package/locale/ig.json.js +17 -17
  247. package/locale/ii/package.json +16 -0
  248. package/locale/ii.json +165 -0
  249. package/locale/ii.json.d.ts +4 -0
  250. package/locale/ii.json.js +165 -0
  251. package/locale/is.json +4 -1
  252. package/locale/is.json.js +4 -1
  253. package/locale/kaa/package.json +16 -0
  254. package/locale/kaa.json +159 -0
  255. package/locale/kaa.json.d.ts +4 -0
  256. package/locale/kaa.json.js +159 -0
  257. package/locale/kok-Latn/package.json +16 -0
  258. package/locale/kok-Latn.json +159 -0
  259. package/locale/kok-Latn.json.d.ts +4 -0
  260. package/locale/kok-Latn.json.js +159 -0
  261. package/locale/kok.json +8 -8
  262. package/locale/kok.json.js +8 -8
  263. package/locale/ks.json +9 -9
  264. package/locale/ks.json.js +9 -9
  265. package/locale/ku.json +55 -46
  266. package/locale/ku.json.js +55 -46
  267. package/locale/lld/package.json +16 -0
  268. package/locale/lld.json +291 -0
  269. package/locale/lld.json.d.ts +4 -0
  270. package/locale/lld.json.js +291 -0
  271. package/locale/mi.json +22 -22
  272. package/locale/mi.json.js +22 -22
  273. package/locale/ms-Arab/package.json +16 -0
  274. package/locale/ms-Arab.json +159 -0
  275. package/locale/ms-Arab.json.d.ts +4 -0
  276. package/locale/ms-Arab.json.js +159 -0
  277. package/locale/nb.json +2 -2
  278. package/locale/nb.json.js +2 -2
  279. package/locale/ne.json +1 -1
  280. package/locale/ne.json.js +1 -1
  281. package/locale/nn.json +4 -4
  282. package/locale/nn.json.js +4 -4
  283. package/locale/no.json +2 -2
  284. package/locale/no.json.js +2 -2
  285. package/locale/nqo/package.json +16 -0
  286. package/locale/nqo.json +159 -0
  287. package/locale/nqo.json.d.ts +4 -0
  288. package/locale/nqo.json.js +159 -0
  289. package/locale/om/package.json +16 -0
  290. package/locale/om.json +213 -0
  291. package/locale/om.json.d.ts +4 -0
  292. package/locale/om.json.js +213 -0
  293. package/locale/or.json +1 -1
  294. package/locale/or.json.js +1 -1
  295. package/locale/qu.json +46 -46
  296. package/locale/qu.json.js +46 -46
  297. package/locale/rhg/package.json +16 -0
  298. package/locale/rhg.json +159 -0
  299. package/locale/rhg.json.d.ts +4 -0
  300. package/locale/rhg.json.js +159 -0
  301. package/locale/sl.json +12 -12
  302. package/locale/sl.json.js +12 -12
  303. package/locale/sr-Cyrl-BA.json +2 -2
  304. package/locale/sr-Cyrl-BA.json.js +2 -2
  305. package/locale/sr-Latn-BA.json +2 -2
  306. package/locale/sr-Latn-BA.json.js +2 -2
  307. package/locale/sv.json +1 -1
  308. package/locale/sv.json.js +1 -1
  309. package/locale/syr/package.json +16 -0
  310. package/locale/syr.json +303 -0
  311. package/locale/syr.json.d.ts +4 -0
  312. package/locale/syr.json.js +303 -0
  313. package/locale/ti.json +6 -6
  314. package/locale/ti.json.js +6 -6
  315. package/locale/tn/package.json +16 -0
  316. package/locale/tn.json +159 -0
  317. package/locale/tn.json.d.ts +4 -0
  318. package/locale/tn.json.js +159 -0
  319. package/locale/to.json +26 -26
  320. package/locale/to.json.js +26 -26
  321. package/locale/uk.json +1 -1
  322. package/locale/uk.json.js +1 -1
  323. package/locale/ur-IN.json +9 -6
  324. package/locale/ur-IN.json.js +9 -6
  325. package/locale/vec/package.json +16 -0
  326. package/locale/vec.json +267 -0
  327. package/locale/vec.json.d.ts +4 -0
  328. package/locale/vec.json.js +267 -0
  329. package/locale/xnr/package.json +16 -0
  330. package/locale/xnr.json +159 -0
  331. package/locale/xnr.json.d.ts +4 -0
  332. package/locale/xnr.json.js +159 -0
  333. package/locale/yo-BJ.json +17 -17
  334. package/locale/yo-BJ.json.js +17 -17
  335. package/locale/yo.json +17 -17
  336. package/locale/yo.json.js +17 -17
  337. package/modules/FullDateFormatter.js +67 -0
  338. package/modules/FullDateFormatter.js.map +1 -0
  339. package/modules/FullDateFormatter.test.js +22 -0
  340. package/modules/FullDateFormatter.test.js.map +1 -0
  341. package/modules/LocaleDataStore.js +2 -3
  342. package/modules/LocaleDataStore.js.map +1 -1
  343. package/modules/PropTypes.js +11 -7
  344. package/modules/PropTypes.js.map +1 -1
  345. package/modules/TimeAgo.js +299 -237
  346. package/modules/TimeAgo.js.map +1 -1
  347. package/modules/TimeAgo.test.js +217 -119
  348. package/modules/TimeAgo.test.js.map +1 -1
  349. package/modules/cache.js +6 -22
  350. package/modules/cache.js.map +1 -1
  351. package/modules/cache.test.js.map +1 -1
  352. package/modules/isStyleObject.js +9 -7
  353. package/modules/isStyleObject.js.map +1 -1
  354. package/modules/isStyleObject.test.js.map +1 -1
  355. package/modules/locale.js +6 -16
  356. package/modules/locale.js.map +1 -1
  357. package/modules/locale.test.js +0 -4
  358. package/modules/locale.test.js.map +1 -1
  359. package/modules/round.js +2 -3
  360. package/modules/round.js.map +1 -1
  361. package/modules/steps/approximate.js +6 -2
  362. package/modules/steps/approximate.js.map +1 -1
  363. package/modules/steps/approximate.test.js +0 -2
  364. package/modules/steps/approximate.test.js.map +1 -1
  365. package/modules/steps/getStep.js +36 -48
  366. package/modules/steps/getStep.js.map +1 -1
  367. package/modules/steps/getStep.test.js +6 -2
  368. package/modules/steps/getStep.test.js.map +1 -1
  369. package/modules/steps/getStepDenominator.js +2 -3
  370. package/modules/steps/getStepDenominator.js.map +1 -1
  371. package/modules/steps/getStepDenominator.test.js.map +1 -1
  372. package/modules/steps/getStepMinTime.js +31 -36
  373. package/modules/steps/getStepMinTime.js.map +1 -1
  374. package/modules/steps/getStepMinTime.test.js.map +1 -1
  375. package/modules/steps/getTimeToNextUpdate.js +28 -32
  376. package/modules/steps/getTimeToNextUpdate.js.map +1 -1
  377. package/modules/steps/getTimeToNextUpdate.test.js +27 -18
  378. package/modules/steps/getTimeToNextUpdate.test.js.map +1 -1
  379. package/modules/steps/getTimeToNextUpdateForUnit.js +4 -10
  380. package/modules/steps/getTimeToNextUpdateForUnit.js.map +1 -1
  381. package/modules/steps/getTimeToNextUpdateForUnit.test.js +0 -4
  382. package/modules/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
  383. package/modules/steps/helpers.js +1 -1
  384. package/modules/steps/helpers.js.map +1 -1
  385. package/modules/steps/helpers.test.js.map +1 -1
  386. package/modules/steps/index.js +2 -1
  387. package/modules/steps/index.js.map +1 -1
  388. package/modules/steps/renameLegacyProperties.js +6 -13
  389. package/modules/steps/renameLegacyProperties.js.map +1 -1
  390. package/modules/steps/renameLegacyProperties.test.js.map +1 -1
  391. package/modules/steps/round.js.map +1 -1
  392. package/modules/steps/round.test.js +0 -3
  393. package/modules/steps/round.test.js.map +1 -1
  394. package/modules/steps/units.js +5 -9
  395. package/modules/steps/units.js.map +1 -1
  396. package/modules/style/approximate.js +5 -1
  397. package/modules/style/approximate.js.map +1 -1
  398. package/modules/style/approximateTime.js +6 -2
  399. package/modules/style/approximateTime.js.map +1 -1
  400. package/modules/style/approximateTime.test.js +115 -70
  401. package/modules/style/approximateTime.test.js.map +1 -1
  402. package/modules/style/getStyleByName.js +4 -17
  403. package/modules/style/getStyleByName.js.map +1 -1
  404. package/modules/style/mini.js +8 -4
  405. package/modules/style/mini.js.map +1 -1
  406. package/modules/style/mini.test.js +14 -20
  407. package/modules/style/mini.test.js.map +1 -1
  408. package/modules/style/miniMinute.js +6 -6
  409. package/modules/style/miniMinute.js.map +1 -1
  410. package/modules/style/miniMinute.test.js +10 -12
  411. package/modules/style/miniMinute.test.js.map +1 -1
  412. package/modules/style/miniMinuteNow.js +6 -6
  413. package/modules/style/miniMinuteNow.js.map +1 -1
  414. package/modules/style/miniMinuteNow.test.js +10 -12
  415. package/modules/style/miniMinuteNow.test.js.map +1 -1
  416. package/modules/style/miniNow.js +6 -6
  417. package/modules/style/miniNow.js.map +1 -1
  418. package/modules/style/miniNow.test.js +10 -12
  419. package/modules/style/miniNow.test.js.map +1 -1
  420. package/modules/style/renameLegacyProperties.js +8 -10
  421. package/modules/style/renameLegacyProperties.js.map +1 -1
  422. package/modules/style/renameLegacyProperties.test.js +0 -1
  423. package/modules/style/renameLegacyProperties.test.js.map +1 -1
  424. package/modules/style/round.js +3 -2
  425. package/modules/style/round.js.map +1 -1
  426. package/modules/style/round.test.js +50 -62
  427. package/modules/style/round.test.js.map +1 -1
  428. package/modules/style/roundMinute.js +8 -7
  429. package/modules/style/roundMinute.js.map +1 -1
  430. package/modules/style/roundMinute.test.js +19 -22
  431. package/modules/style/roundMinute.test.js.map +1 -1
  432. package/modules/style/twitter.js +36 -33
  433. package/modules/style/twitter.js.map +1 -1
  434. package/modules/style/twitter.test.js +53 -52
  435. package/modules/style/twitter.test.js.map +1 -1
  436. package/modules/style/twitterFirstMinute.js +8 -7
  437. package/modules/style/twitterFirstMinute.js.map +1 -1
  438. package/modules/style/twitterFirstMinute.test.js +15 -18
  439. package/modules/style/twitterFirstMinute.test.js.map +1 -1
  440. package/modules/style/twitterMinute.js +6 -6
  441. package/modules/style/twitterMinute.js.map +1 -1
  442. package/modules/style/twitterMinute.test.js +19 -20
  443. package/modules/style/twitterMinute.test.js.map +1 -1
  444. package/modules/style/twitterMinuteNow.js +6 -6
  445. package/modules/style/twitterMinuteNow.js.map +1 -1
  446. package/modules/style/twitterMinuteNow.test.js +19 -20
  447. package/modules/style/twitterMinuteNow.test.js.map +1 -1
  448. package/modules/style/twitterNow.js +6 -6
  449. package/modules/style/twitterNow.js.map +1 -1
  450. package/modules/style/twitterNow.test.js +17 -19
  451. package/modules/style/twitterNow.test.js.map +1 -1
  452. package/package.json +275 -13
@@ -1,7 +1,10 @@
1
- import { day, getDate } from '../steps/index.js';
2
- import { intlDateTimeFormatSupported } from '../locale.js'; // For compatibility with the old versions of this library.
1
+ import { getDate } from '../steps/index.js';
2
+ import { intlDateTimeFormatSupported } from '../locale.js';
3
3
 
4
- import renameLegacyProperties from './renameLegacyProperties.js'; // Twitter-style relative date/time formatting.
4
+ // // For compatibility with the old versions of this library.
5
+ // import renameLegacyProperties from './renameLegacyProperties.js'
6
+
7
+ // Twitter-style relative date/time formatting.
5
8
  // ("1m", "2h", "Mar 3", "Apr 4, 2012").
6
9
  //
7
10
  // Seconds, minutes or hours are shown for shorter intervals,
@@ -13,15 +16,17 @@ var steps = [{
13
16
  formatAs: 'minute'
14
17
  }, {
15
18
  formatAs: 'hour'
16
- }]; // A cache for `Intl.DateTimeFormat` formatters
17
- // for various locales (is a global variable).
19
+ }];
18
20
 
19
- var formatters = {}; // Starting from day intervals, output month and day.
21
+ // A cache for `Intl.DateTimeFormat` formatters
22
+ // for various locales (is a global variable).
23
+ var formatters = {};
20
24
 
25
+ // Starting from day intervals, output month and day.
21
26
  var monthAndDay = {
22
27
  minTime: function minTime(timestamp, _ref) {
23
28
  var future = _ref.future,
24
- getMinTimeForUnit = _ref.getMinTimeForUnit;
29
+ getMinTimeForUnit = _ref.getMinTimeForUnit;
25
30
  // Returns `23.5 * 60 * 60` when `round` is "round",
26
31
  // and `24 * 60 * 60` when `round` is "floor".
27
32
  return getMinTimeForUnit('day');
@@ -32,27 +37,24 @@ var monthAndDay = {
32
37
  formatters[locale] = {};
33
38
  }
34
39
  /* istanbul ignore else */
35
-
36
-
37
40
  if (!formatters[locale].dayMonth) {
38
41
  // "Apr 11" (MMMd)
39
42
  formatters[locale].dayMonth = new Intl.DateTimeFormat(locale, {
40
43
  month: 'short',
41
44
  day: 'numeric'
42
45
  });
43
- } // Output month and day.
44
-
45
-
46
+ }
47
+ // Output month and day.
46
48
  return formatters[locale].dayMonth.format(getDate(value));
47
49
  }
48
- }; // If the `date` happened/happens outside of current year,
50
+ };
51
+
52
+ // If the `date` happened/happens outside of current year,
49
53
  // then output day, month and year.
50
54
  // The interval should be such that the `date` lies outside of the current year.
51
-
52
55
  var yearMonthAndDay = {
53
56
  minTime: function minTime(timestamp, _ref2) {
54
57
  var future = _ref2.future;
55
-
56
58
  if (future) {
57
59
  // January 1, 00:00, of the `date`'s year is right after
58
60
  // the maximum `now` for formatting a future date:
@@ -61,8 +63,8 @@ var yearMonthAndDay = {
61
63
  // After that, it's hours, minutes, seconds, and after that it's no longer `future`.
62
64
  // The date is right after the maximum `now` for formatting a future date,
63
65
  // so subtract 1 millisecond from it.
64
- var maxFittingNow = new Date(new Date(timestamp).getFullYear(), 0).getTime() - 1; // Return `minTime` (in seconds).
65
-
66
+ var maxFittingNow = new Date(new Date(timestamp).getFullYear(), 0).getTime() - 1;
67
+ // Return `minTime` (in seconds).
66
68
  return (timestamp - maxFittingNow) / 1000;
67
69
  } else {
68
70
  // January 1, 00:00, of the year following the `date`'s year
@@ -70,8 +72,8 @@ var yearMonthAndDay = {
70
72
  // When `now` is before that date, the `date` is formatted as "day/month" (another step),
71
73
  // When `now` is equal to or after that date, the `date` is formatted as "day/month/year" (this step).
72
74
  // After that, it's hours, minutes, seconds, and after that it's no longer `future`.
73
- var minFittingNow = new Date(new Date(timestamp).getFullYear() + 1, 0).getTime(); // Return `minTime` (in seconds).
74
-
75
+ var minFittingNow = new Date(new Date(timestamp).getFullYear() + 1, 0).getTime();
76
+ // Return `minTime` (in seconds).
75
77
  return (minFittingNow - timestamp) / 1000;
76
78
  }
77
79
  },
@@ -81,8 +83,6 @@ var yearMonthAndDay = {
81
83
  formatters[locale] = {};
82
84
  }
83
85
  /* istanbul ignore else */
84
-
85
-
86
86
  if (!formatters[locale].dayMonthYear) {
87
87
  // "Apr 11, 2017" (yMMMd)
88
88
  formatters[locale].dayMonthYear = new Intl.DateTimeFormat(locale, {
@@ -90,19 +90,19 @@ var yearMonthAndDay = {
90
90
  month: 'short',
91
91
  day: 'numeric'
92
92
  });
93
- } // Output day, month and year.
94
-
95
-
93
+ }
94
+ // Output day, month and year.
96
95
  return formatters[locale].dayMonthYear.format(getDate(value));
97
96
  }
98
- }; // If `Intl.DateTimeFormat` is supported,
99
- // then longer time intervals will be formatted as dates.
97
+ };
100
98
 
99
+ // If `Intl.DateTimeFormat` is supported,
100
+ // then longer time intervals will be formatted as dates.
101
101
  /* istanbul ignore else */
102
-
103
102
  if (intlDateTimeFormatSupported()) {
104
103
  steps.push(monthAndDay, yearMonthAndDay);
105
- } // Otherwise, if `Intl.DateTimeFormat` is not supported,
104
+ }
105
+ // Otherwise, if `Intl.DateTimeFormat` is not supported,
106
106
  // which could be the case when using Internet Explorer,
107
107
  // then simply mimick "round" steps.
108
108
  else {
@@ -116,18 +116,21 @@ else {
116
116
  formatAs: 'year'
117
117
  });
118
118
  }
119
-
120
119
  export default {
121
120
  steps: steps,
122
- labels: [// "mini" labels are only defined for a few languages.
123
- 'mini', // "short-time" labels are only defined for a few languages.
124
- 'short-time', // "narrow" and "short" labels are defined for all languages.
121
+ labels: [
122
+ // "mini" labels are only defined for a few languages.
123
+ 'mini',
124
+ // "short-time" labels are only defined for a few languages.
125
+ 'short-time',
126
+ // "narrow" and "short" labels are defined for all languages.
125
127
  // "narrow" labels can sometimes be weird (like "+5d."),
126
128
  // but "short" labels have the " ago" part, so "narrow" seem
127
129
  // more appropriate.
128
130
  // "short" labels would have been more appropriate if they
129
131
  // didn't have the " ago" part, hence the "short-time" above.
130
- 'narrow', // Since "narrow" labels are always present, "short" element
132
+ 'narrow',
133
+ // Since "narrow" labels are always present, "short" element
131
134
  // of this array can be removed.
132
135
  'short']
133
136
  };
@@ -1 +1 @@
1
- {"version":3,"file":"twitter.js","names":["day","getDate","intlDateTimeFormatSupported","renameLegacyProperties","steps","formatAs","formatters","monthAndDay","minTime","timestamp","future","getMinTimeForUnit","format","value","locale","dayMonth","Intl","DateTimeFormat","month","yearMonthAndDay","maxFittingNow","Date","getFullYear","getTime","minFittingNow","dayMonthYear","year","push","labels"],"sources":["../../source/style/twitter.js"],"sourcesContent":["import { day, getDate } from '../steps/index.js'\r\nimport { intlDateTimeFormatSupported } from '../locale.js'\r\n\r\n// For compatibility with the old versions of this library.\r\nimport renameLegacyProperties from './renameLegacyProperties.js'\r\n\r\n// Twitter-style relative date/time formatting.\r\n// (\"1m\", \"2h\", \"Mar 3\", \"Apr 4, 2012\").\r\n//\r\n// Seconds, minutes or hours are shown for shorter intervals,\r\n// and longer intervals are formatted using full date format.\r\n\r\nconst steps = [\r\n\t{\r\n\t\tformatAs: 'second'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'minute'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'hour'\r\n\t}\r\n]\r\n\r\n// A cache for `Intl.DateTimeFormat` formatters\r\n// for various locales (is a global variable).\r\nconst formatters = {}\r\n\r\n// Starting from day intervals, output month and day.\r\nconst monthAndDay = {\r\n\tminTime(timestamp, { future, getMinTimeForUnit }) {\r\n\t\t// Returns `23.5 * 60 * 60` when `round` is \"round\",\r\n\t\t// and `24 * 60 * 60` when `round` is \"floor\".\r\n\t\treturn getMinTimeForUnit('day')\r\n\t},\r\n\tformat(value, locale) {\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale]) {\r\n\t\t\tformatters[locale] = {}\r\n\t\t}\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale].dayMonth) {\r\n\t\t\t// \"Apr 11\" (MMMd)\r\n\t\t\tformatters[locale].dayMonth = new Intl.DateTimeFormat(locale, {\r\n\t\t\t\tmonth: 'short',\r\n\t\t\t\tday: 'numeric'\r\n\t\t\t})\r\n\t\t}\r\n\t\t// Output month and day.\r\n\t\treturn formatters[locale].dayMonth.format(getDate(value))\r\n\t}\r\n}\r\n\r\n// If the `date` happened/happens outside of current year,\r\n// then output day, month and year.\r\n// The interval should be such that the `date` lies outside of the current year.\r\nconst yearMonthAndDay = {\r\n\tminTime(timestamp, { future }) {\r\n\t\tif (future) {\r\n\t\t\t// January 1, 00:00, of the `date`'s year is right after\r\n\t\t\t// the maximum `now` for formatting a future date:\r\n\t\t\t// When `now` is before that date, the `date` is formatted as \"day/month/year\" (this step),\r\n\t\t\t// When `now` is equal to or after that date, the `date` is formatted as \"day/month\" (another step).\r\n\t\t\t// After that, it's hours, minutes, seconds, and after that it's no longer `future`.\r\n\t\t\t// The date is right after the maximum `now` for formatting a future date,\r\n\t\t\t// so subtract 1 millisecond from it.\r\n\t\t\tconst maxFittingNow = new Date(new Date(timestamp).getFullYear(), 0).getTime() - 1\r\n\t\t\t// Return `minTime` (in seconds).\r\n\t\t\treturn (timestamp - maxFittingNow) / 1000\r\n\t\t} else {\r\n\t\t\t// January 1, 00:00, of the year following the `date`'s year\r\n\t\t\t// is the minimum `now` for formatting a past date:\r\n\t\t\t// When `now` is before that date, the `date` is formatted as \"day/month\" (another step),\r\n\t\t\t// When `now` is equal to or after that date, the `date` is formatted as \"day/month/year\" (this step).\r\n\t\t\t// After that, it's hours, minutes, seconds, and after that it's no longer `future`.\r\n\t\t\tconst minFittingNow = new Date(new Date(timestamp).getFullYear() + 1, 0).getTime()\r\n\t\t\t// Return `minTime` (in seconds).\r\n\t\t\treturn (minFittingNow - timestamp) / 1000\r\n\t\t}\r\n\t},\r\n\tformat(value, locale) {\r\n\t\t/* istanbul ignore if */\r\n\t\tif (!formatters[locale]) {\r\n\t\t\tformatters[locale] = {}\r\n\t\t}\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale].dayMonthYear) {\r\n\t\t\t// \"Apr 11, 2017\" (yMMMd)\r\n\t\t\tformatters[locale].dayMonthYear = new Intl.DateTimeFormat(locale, {\r\n\t\t\t\tyear: 'numeric',\r\n\t\t\t\tmonth: 'short',\r\n\t\t\t\tday: 'numeric'\r\n\t\t\t})\r\n\t\t}\r\n\t\t// Output day, month and year.\r\n\t\treturn formatters[locale].dayMonthYear.format(getDate(value))\r\n\t}\r\n}\r\n\r\n// If `Intl.DateTimeFormat` is supported,\r\n// then longer time intervals will be formatted as dates.\r\n/* istanbul ignore else */\r\nif (intlDateTimeFormatSupported()) {\r\n\tsteps.push(monthAndDay, yearMonthAndDay)\r\n}\r\n// Otherwise, if `Intl.DateTimeFormat` is not supported,\r\n// which could be the case when using Internet Explorer,\r\n// then simply mimick \"round\" steps.\r\nelse {\r\n\tsteps.push(\r\n\t\t{\r\n\t\t\tformatAs: 'day'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'week'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'month'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'year'\r\n\t\t}\r\n\t)\r\n}\r\n\r\nexport default {\r\n\tsteps,\r\n\tlabels: [\r\n\t\t// \"mini\" labels are only defined for a few languages.\r\n\t\t'mini',\r\n\t\t// \"short-time\" labels are only defined for a few languages.\r\n\t\t'short-time',\r\n\t\t// \"narrow\" and \"short\" labels are defined for all languages.\r\n\t\t// \"narrow\" labels can sometimes be weird (like \"+5d.\"),\r\n\t\t// but \"short\" labels have the \" ago\" part, so \"narrow\" seem\r\n\t\t// more appropriate.\r\n\t\t// \"short\" labels would have been more appropriate if they\r\n\t\t// didn't have the \" ago\" part, hence the \"short-time\" above.\r\n\t\t'narrow',\r\n\t\t// Since \"narrow\" labels are always present, \"short\" element\r\n\t\t// of this array can be removed.\r\n\t\t'short'\r\n\t]\r\n}"],"mappings":"AAAA,SAASA,GAAT,EAAcC,OAAd,QAA6B,mBAA7B;AACA,SAASC,2BAAT,QAA4C,cAA5C,C,CAEA;;AACA,OAAOC,sBAAP,MAAmC,6BAAnC,C,CAEA;AACA;AACA;AACA;AACA;;AAEA,IAAMC,KAAK,GAAG,CACb;EACCC,QAAQ,EAAE;AADX,CADa,EAIb;EACCA,QAAQ,EAAE;AADX,CAJa,EAOb;EACCA,QAAQ,EAAE;AADX,CAPa,CAAd,C,CAYA;AACA;;AACA,IAAMC,UAAU,GAAG,EAAnB,C,CAEA;;AACA,IAAMC,WAAW,GAAG;EACnBC,OADmB,mBACXC,SADW,QAC+B;IAAA,IAA7BC,MAA6B,QAA7BA,MAA6B;IAAA,IAArBC,iBAAqB,QAArBA,iBAAqB;IACjD;IACA;IACA,OAAOA,iBAAiB,CAAC,KAAD,CAAxB;EACA,CALkB;EAMnBC,MANmB,kBAMZC,KANY,EAMLC,MANK,EAMG;IACrB;IACA,IAAI,CAACR,UAAU,CAACQ,MAAD,CAAf,EAAyB;MACxBR,UAAU,CAACQ,MAAD,CAAV,GAAqB,EAArB;IACA;IACD;;;IACA,IAAI,CAACR,UAAU,CAACQ,MAAD,CAAV,CAAmBC,QAAxB,EAAkC;MACjC;MACAT,UAAU,CAACQ,MAAD,CAAV,CAAmBC,QAAnB,GAA8B,IAAIC,I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QACjEY,IAAI,EAAE,SAD2D;QAEjER,KAAK,EAAE,OAF0D;QAGjElB,GAAG,EAAE;MAH4D,CAAhC,CAAlC;IAKA,CAboB,CAcrB;;;IACA,OAAOM,UAAU,CAACQ,MAAD,CAAV,CAAmBW,YAAnB,CAAgCb,MAAhC,CAAuCX,OAAO,CAACY,KAAD,CAA9C,CAAP;EACA;AAxCsB,CAAxB,C,CA2CA;AACA;;AACA;;AACA,IAAIX,2BAA2B,EAA/B,EAAmC;EAClCE,KAAK,CAACuB,IAAN,CAAWpB,WAAX,EAAwBY,eAAxB;AACA,CAFD,CAGA;AACA;AACA;AALA,KAMK;EACJf,KAAK,CAACuB,IAAN,CACC;IACCtB,QAAQ,EAAE;EADX,CADD,EAIC;IACCA,QAAQ,EAAE;EADX,CAJD,EAOC;IACCA,QAAQ,EAAE;EADX,CAPD,EAUC;IACCA,QAAQ,EAAE;EADX,CAVD;AAcA;;AAED,eAAe;EACdD,KAAK,EAALA,KADc;EAEdwB,MAAM,EAAE,CACP;EACA,MAFO,EAGP;EACA,YAJO,EAKP;EACA;EACA;EACA;EACA;EACA;EACA,QAXO,EAYP;EACA;EACA,OAdO;AAFM,CAAf"}
1
+ {"version":3,"file":"twitter.js","names":["getDate","intlDateTimeFormatSupported","steps","formatAs","formatters","monthAndDay","minTime","timestamp","_ref","future","getMinTimeForUnit","format","value","locale","dayMonth","Intl","DateTimeFormat","month","day","yearMonthAndDay","_ref2","maxFittingNow","Date","getFullYear","getTime","minFittingNow","dayMonthYear","year","push","labels"],"sources":["../../source/style/twitter.js"],"sourcesContent":["import { getDate } from '../steps/index.js'\r\nimport { intlDateTimeFormatSupported } from '../locale.js'\r\n\r\n// // For compatibility with the old versions of this library.\r\n// import renameLegacyProperties from './renameLegacyProperties.js'\r\n\r\n// Twitter-style relative date/time formatting.\r\n// (\"1m\", \"2h\", \"Mar 3\", \"Apr 4, 2012\").\r\n//\r\n// Seconds, minutes or hours are shown for shorter intervals,\r\n// and longer intervals are formatted using full date format.\r\n\r\nconst steps = [\r\n\t{\r\n\t\tformatAs: 'second'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'minute'\r\n\t},\r\n\t{\r\n\t\tformatAs: 'hour'\r\n\t}\r\n]\r\n\r\n// A cache for `Intl.DateTimeFormat` formatters\r\n// for various locales (is a global variable).\r\nconst formatters = {}\r\n\r\n// Starting from day intervals, output month and day.\r\nconst monthAndDay = {\r\n\tminTime(timestamp, { future, getMinTimeForUnit }) {\r\n\t\t// Returns `23.5 * 60 * 60` when `round` is \"round\",\r\n\t\t// and `24 * 60 * 60` when `round` is \"floor\".\r\n\t\treturn getMinTimeForUnit('day')\r\n\t},\r\n\tformat(value, locale) {\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale]) {\r\n\t\t\tformatters[locale] = {}\r\n\t\t}\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale].dayMonth) {\r\n\t\t\t// \"Apr 11\" (MMMd)\r\n\t\t\tformatters[locale].dayMonth = new Intl.DateTimeFormat(locale, {\r\n\t\t\t\tmonth: 'short',\r\n\t\t\t\tday: 'numeric'\r\n\t\t\t})\r\n\t\t}\r\n\t\t// Output month and day.\r\n\t\treturn formatters[locale].dayMonth.format(getDate(value))\r\n\t}\r\n}\r\n\r\n// If the `date` happened/happens outside of current year,\r\n// then output day, month and year.\r\n// The interval should be such that the `date` lies outside of the current year.\r\nconst yearMonthAndDay = {\r\n\tminTime(timestamp, { future }) {\r\n\t\tif (future) {\r\n\t\t\t// January 1, 00:00, of the `date`'s year is right after\r\n\t\t\t// the maximum `now` for formatting a future date:\r\n\t\t\t// When `now` is before that date, the `date` is formatted as \"day/month/year\" (this step),\r\n\t\t\t// When `now` is equal to or after that date, the `date` is formatted as \"day/month\" (another step).\r\n\t\t\t// After that, it's hours, minutes, seconds, and after that it's no longer `future`.\r\n\t\t\t// The date is right after the maximum `now` for formatting a future date,\r\n\t\t\t// so subtract 1 millisecond from it.\r\n\t\t\tconst maxFittingNow = new Date(new Date(timestamp).getFullYear(), 0).getTime() - 1\r\n\t\t\t// Return `minTime` (in seconds).\r\n\t\t\treturn (timestamp - maxFittingNow) / 1000\r\n\t\t} else {\r\n\t\t\t// January 1, 00:00, of the year following the `date`'s year\r\n\t\t\t// is the minimum `now` for formatting a past date:\r\n\t\t\t// When `now` is before that date, the `date` is formatted as \"day/month\" (another step),\r\n\t\t\t// When `now` is equal to or after that date, the `date` is formatted as \"day/month/year\" (this step).\r\n\t\t\t// After that, it's hours, minutes, seconds, and after that it's no longer `future`.\r\n\t\t\tconst minFittingNow = new Date(new Date(timestamp).getFullYear() + 1, 0).getTime()\r\n\t\t\t// Return `minTime` (in seconds).\r\n\t\t\treturn (minFittingNow - timestamp) / 1000\r\n\t\t}\r\n\t},\r\n\tformat(value, locale) {\r\n\t\t/* istanbul ignore if */\r\n\t\tif (!formatters[locale]) {\r\n\t\t\tformatters[locale] = {}\r\n\t\t}\r\n\t\t/* istanbul ignore else */\r\n\t\tif (!formatters[locale].dayMonthYear) {\r\n\t\t\t// \"Apr 11, 2017\" (yMMMd)\r\n\t\t\tformatters[locale].dayMonthYear = new Intl.DateTimeFormat(locale, {\r\n\t\t\t\tyear: 'numeric',\r\n\t\t\t\tmonth: 'short',\r\n\t\t\t\tday: 'numeric'\r\n\t\t\t})\r\n\t\t}\r\n\t\t// Output day, month and year.\r\n\t\treturn formatters[locale].dayMonthYear.format(getDate(value))\r\n\t}\r\n}\r\n\r\n// If `Intl.DateTimeFormat` is supported,\r\n// then longer time intervals will be formatted as dates.\r\n/* istanbul ignore else */\r\nif (intlDateTimeFormatSupported()) {\r\n\tsteps.push(monthAndDay, yearMonthAndDay)\r\n}\r\n// Otherwise, if `Intl.DateTimeFormat` is not supported,\r\n// which could be the case when using Internet Explorer,\r\n// then simply mimick \"round\" steps.\r\nelse {\r\n\tsteps.push(\r\n\t\t{\r\n\t\t\tformatAs: 'day'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'week'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'month'\r\n\t\t},\r\n\t\t{\r\n\t\t\tformatAs: 'year'\r\n\t\t}\r\n\t)\r\n}\r\n\r\nexport default {\r\n\tsteps,\r\n\tlabels: [\r\n\t\t// \"mini\" labels are only defined for a few languages.\r\n\t\t'mini',\r\n\t\t// \"short-time\" labels are only defined for a few languages.\r\n\t\t'short-time',\r\n\t\t// \"narrow\" and \"short\" labels are defined for all languages.\r\n\t\t// \"narrow\" labels can sometimes be weird (like \"+5d.\"),\r\n\t\t// but \"short\" labels have the \" ago\" part, so \"narrow\" seem\r\n\t\t// more appropriate.\r\n\t\t// \"short\" labels would have been more appropriate if they\r\n\t\t// didn't have the \" ago\" part, hence the \"short-time\" above.\r\n\t\t'narrow',\r\n\t\t// Since \"narrow\" labels are always present, \"short\" element\r\n\t\t// of this array can be removed.\r\n\t\t'short'\r\n\t]\r\n}"],"mappings":"AAAA,SAASA,OAAO,QAAQ,mBAAmB;AAC3C,SAASC,2BAA2B,QAAQ,cAAc;;AAE1D;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,IAAMC,KAAK,GAAG,CACb;EACCC,QAAQ,EAAE;AACX,CAAC,EACD;EACCA,QAAQ,EAAE;AACX,CAAC,EACD;EACCA,QAAQ,EAAE;AACX,CAAC,CACD;;AAED;AACA;AACA,IAAMC,UAAU,GAAG,CAAC,CAAC;;AAErB;AACA,IAAMC,WAAW,GAAG;EACnBC,OAAO,WAAAA,QAACC,SAAS,EAAAC,IAAA,EAAiC;IAAA,IAA7BC,MAAM,GAAAD,IAAA,CAANC,MAAM;MAAEC,iBAAiB,GAAAF,IAAA,CAAjBE,iBAAiB;IAC7C;IACA;IACA,OAAOA,iBAAiB,CAAC,KAAK,CAAC;EAChC,CAAC;EACDC,MAAM,WAAAA,OAACC,KAAK,EAAEC,MAAM,EAAE;IACrB;IACA,IAAI,CAACT,UAAU,CAACS,MAAM,CAAC,EAAE;MACxBT,UAAU,CAACS,MAAM,CAAC,G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AU,CAACS,MAAM,CAAC,CAACa,YAAY,EAAE;MACrC;MACAtB,UAAU,CAACS,MAAM,CAAC,CAACa,YAAY,GAAG,IAAIX,IAAI,CAACC,cAAc,CAACH,MAAM,EAAE;QACjEc,IAAI,EAAE,SAAS;QACfV,KAAK,EAAE,OAAO;QACdC,GAAG,EAAE;MACN,CAAC,CAAC;IACH;IACA;IACA,OAAOd,UAAU,CAACS,MAAM,CAAC,CAACa,YAAY,CAACf,MAAM,CAACX,OAAO,CAACY,KAAK,CAAC,CAAC;EAC9D;AACD,CAAC;;AAED;AACA;AACA;AACA,IAAIX,2BAA2B,CAAC,CAAC,EAAE;EAClCC,KAAK,CAAC0B,IAAI,CAACvB,WAAW,EAAEc,eAAe,CAAC;AACzC;AACA;AACA;AACA;AAAA,KACK;EACJjB,KAAK,CAAC0B,IAAI,CACT;IACCzB,QAAQ,EAAE;EACX,CAAC,EACD;IACCA,QAAQ,EAAE;EACX,CAAC,EACD;IACCA,QAAQ,EAAE;EACX,CAAC,EACD;IACCA,QAAQ,EAAE;EACX,CACD,CAAC;AACF;AAEA,eAAe;EACdD,KAAK,EAALA,KAAK;EACL2B,MAAM,EAAE;EACP;EACA,MAAM;EACN;EACA,YAAY;EACZ;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA,OAAO;AAET,CAAC","ignoreList":[]}
@@ -1,9 +1,9 @@
1
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
-
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
-
5
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import twitter from './twitter.js';
8
8
  import TimeAgo from '../TimeAgo.js';
9
9
  import { hour, minute, day, month, year } from '../steps/index.js';
@@ -14,30 +14,27 @@ describe('style/twitter', function () {
14
14
  });
15
15
  it('should format Twitter style relative time (English) (round: "round")', function () {
16
16
  var timeAgo = new TimeAgo('en');
17
-
18
17
  var formatDatePastBy = function formatDatePastBy(secondsPassed) {
19
18
  return timeAgo.format(-secondsPassed * 1000, _objectSpread({
20
19
  now: 0
21
20
  }, twitter));
22
21
  };
23
-
24
22
  formatDatePastBy(0.49).should.equal('0s');
25
23
  formatDatePastBy(0.5).should.equal('1s');
26
24
  formatDatePastBy(59.49).should.equal('59s');
27
25
  formatDatePastBy(59.5).should.equal('1m');
28
26
  formatDatePastBy(1.49 * minute).should.equal('1m');
29
- formatDatePastBy(1.5 * minute).should.equal('2m'); // โ€ฆ
30
-
27
+ formatDatePastBy(1.5 * minute).should.equal('2m');
28
+ // โ€ฆ
31
29
  formatDatePastBy(59.49 * minute).should.equal('59m');
32
30
  formatDatePastBy(59.5 * minute).should.equal('1h');
33
31
  formatDatePastBy(1.49 * hour).should.equal('1h');
34
- formatDatePastBy(1.5 * hour).should.equal('2h'); // โ€ฆ
35
-
32
+ formatDatePastBy(1.5 * hour).should.equal('2h');
33
+ // โ€ฆ
36
34
  formatDatePastBy(23.49 * hour).should.equal('23h');
37
35
  });
38
36
  it('should format Twitter style relative time (English) (round: "floor")', function () {
39
37
  var timeAgo = new TimeAgo('en');
40
-
41
38
  var formatDatePastBy = function formatDatePastBy(secondsPassed) {
42
39
  return timeAgo.format(-secondsPassed * 1000, _objectSpread(_objectSpread({
43
40
  now: 0
@@ -45,7 +42,6 @@ describe('style/twitter', function () {
45
42
  round: 'floor'
46
43
  }));
47
44
  };
48
-
49
45
  formatDatePastBy(0).should.equal('0s');
50
46
  formatDatePastBy(0.9).should.equal('0s');
51
47
  formatDatePastBy(1).should.equal('1s');
@@ -54,49 +50,47 @@ describe('style/twitter', function () {
54
50
  formatDatePastBy(1.9 * minute).should.equal('1m');
55
51
  formatDatePastBy(2 * minute).should.equal('2m');
56
52
  formatDatePastBy(2.9 * minute).should.equal('2m');
57
- formatDatePastBy(3 * minute).should.equal('3m'); // โ€ฆ
58
-
53
+ formatDatePastBy(3 * minute).should.equal('3m');
54
+ // โ€ฆ
59
55
  formatDatePastBy(59.9 * minute).should.equal('59m');
60
56
  formatDatePastBy(60 * minute).should.equal('1h');
61
57
  formatDatePastBy(1.9 * hour).should.equal('1h');
62
58
  formatDatePastBy(2 * hour).should.equal('2h');
63
59
  formatDatePastBy(2.9 * hour).should.equal('2h');
64
- formatDatePastBy(3 * hour).should.equal('3h'); // โ€ฆ
65
-
60
+ formatDatePastBy(3 * hour).should.equal('3h');
61
+ // โ€ฆ
66
62
  formatDatePastBy(23.9 * hour).should.equal('23h');
67
63
  });
68
64
  it('should format Twitter style relative time (English) (absolute dates)', function () {
69
- var timeAgo = new TimeAgo('en'); // April 10th, 2016, 12:00.
65
+ var timeAgo = new TimeAgo('en');
70
66
 
67
+ // April 10th, 2016, 12:00.
71
68
  var now = new Date(2016, 3, 10, 12, 0).getTime();
72
-
73
69
  var formatDatePastBy = function formatDatePastBy(secondsPassed) {
74
70
  return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
75
71
  now: now
76
72
  }, twitter));
77
73
  };
78
-
79
- formatDatePastBy(day + 2 * minute + hour).should.equal('Apr 9'); // โ€ฆ
74
+ formatDatePastBy(day + 2 * minute + hour).should.equal('Apr 9');
75
+ // โ€ฆ
80
76
  // `month` is about 30.5 days.
81
-
82
77
  formatDatePastBy(month * 3).should.equal('Jan 10');
83
78
  formatDatePastBy(month * 4).should.equal('Dec 10, 2015');
84
- formatDatePastBy(year).should.equal('Apr 11, 2015'); // Test future dates.
85
- // `month` is about 30.5 days.
79
+ formatDatePastBy(year).should.equal('Apr 11, 2015');
86
80
 
81
+ // Test future dates.
82
+ // `month` is about 30.5 days.
87
83
  formatDatePastBy(-1 * month * 8).should.equal('Dec 10');
88
84
  formatDatePastBy(-1 * month * 9).should.equal('Jan 9, 2017');
89
85
  });
90
86
  it('should format Twitter style relative time (Russian)', function () {
91
87
  var timeAgo = new TimeAgo('ru');
92
88
  var now = new Date(2016, 3, 10, 22, 59).getTime();
93
-
94
89
  var formatDatePastBy = function formatDatePastBy(secondsPassed) {
95
90
  return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
96
91
  now: now
97
92
  }, twitter));
98
93
  };
99
-
100
94
  formatDatePastBy(0).should.equal('0 ั');
101
95
  formatDatePastBy(1).should.equal('1 ั');
102
96
  formatDatePastBy(minute).should.equal('1 ะผะธะฝ');
@@ -107,13 +101,11 @@ describe('style/twitter', function () {
107
101
  it('should format Twitter style relative time (Korean)', function () {
108
102
  var timeAgo = new TimeAgo('ko');
109
103
  var now = new Date(2016, 3, 10, 22, 59).getTime();
110
-
111
104
  var formatDatePastBy = function formatDatePastBy(secondsPassed) {
112
105
  return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
113
106
  now: now
114
107
  }, twitter));
115
108
  };
116
-
117
109
  formatDatePastBy(minute).should.equal('1๋ถ„');
118
110
  formatDatePastBy(hour).should.equal('1์‹œ๊ฐ„');
119
111
  formatDatePastBy(day + 62 * minute).should.equal('4์›” 9์ผ');
@@ -122,13 +114,11 @@ describe('style/twitter', function () {
122
114
  it('should format Twitter style relative time (German)', function () {
123
115
  var timeAgo = new TimeAgo('de');
124
116
  var now = new Date(2016, 3, 10, 22, 59).getTime();
125
-
126
117
  var formatDatePastBy = function formatDatePastBy(secondsPassed) {
127
118
  return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
128
119
  now: now
129
120
  }, twitter));
130
121
  };
131
-
132
122
  formatDatePastBy(minute).should.equal('1 Min.');
133
123
  formatDatePastBy(hour).should.equal('1 Std.');
134
124
  formatDatePastBy(day + 62 * minute).should.equal('9. Apr.');
@@ -137,13 +127,11 @@ describe('style/twitter', function () {
137
127
  it('should format Twitter style relative time (French)', function () {
138
128
  var timeAgo = new TimeAgo('fr');
139
129
  var now = new Date(2016, 3, 10, 22, 59).getTime();
140
-
141
130
  var formatDatePastBy = function formatDatePastBy(secondsPassed) {
142
131
  return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
143
132
  now: now
144
133
  }, twitter));
145
134
  };
146
-
147
135
  formatDatePastBy(minute).should.equal('1 min.');
148
136
  formatDatePastBy(hour).should.equal('1 h');
149
137
  formatDatePastBy(day + 62 * minute).should.equal('9 avr.');
@@ -152,18 +140,18 @@ describe('style/twitter', function () {
152
140
  it('should format Twitter style relative time (Chinese)', function () {
153
141
  var timeAgo = new TimeAgo('zh');
154
142
  var now = new Date(2016, 3, 10, 22, 59).getTime();
155
-
156
143
  var formatDatePastBy = function formatDatePastBy(secondsPassed) {
157
144
  return timeAgo.format(now - secondsPassed * 1000, _objectSpread({
158
145
  now: now
159
146
  }, twitter));
160
147
  };
161
-
162
148
  formatDatePastBy(minute).should.equal('1ๅˆ†้’Ÿ');
163
149
  formatDatePastBy(hour).should.equal('1ๅฐๆ—ถ');
164
150
  formatDatePastBy(day + 62 * minute).should.equal('4ๆœˆ9ๆ—ฅ');
165
151
  formatDatePastBy(year).should.equal('2015ๅนด4ๆœˆ11ๆ—ฅ');
166
- }); // This test won't pass because `Intl.DateTimeFormat` is read at
152
+ });
153
+
154
+ // This test won't pass because `Intl.DateTimeFormat` is read at
167
155
  // initialization time, not at run time.
168
156
  // it('should fall back to generic style when Intl.DateTimeFormat is not available', () => {
169
157
  // const DateTimeFormat = Intl.DateTimeFormat
@@ -181,14 +169,12 @@ describe('style/twitter', function () {
181
169
  });
182
170
  it('should round as "floor"', function () {
183
171
  var timeAgo = new TimeAgo('en');
184
-
185
172
  var test = function test(time, result) {
186
173
  return timeAgo.format(time, 'twitter', {
187
174
  round: 'floor',
188
175
  now: 0
189
176
  }).should.equal(result);
190
177
  };
191
-
192
178
  test(2001, '2s');
193
179
  test(2000, '2s');
194
180
  test(1999, '1s');
@@ -204,51 +190,66 @@ describe('style/twitter', function () {
204
190
  test(-2001, '2s');
205
191
  });
206
192
  it('should get time to next update (round: "floor")', function () {
207
- var timeAgo = new TimeAgo('en'); // April 10th, 2018, 12:00.
193
+ var timeAgo = new TimeAgo('en');
208
194
 
209
- var date = new Date(2018, 3, 10, 12, 0); // April 10th, 2016, 12:00 (two years earlier).
195
+ // April 10th, 2018, 12:00.
196
+ var date = new Date(2018, 3, 10, 12, 0);
210
197
 
198
+ // April 10th, 2016, 12:00 (two years earlier).
211
199
  var now = new Date(2016, 3, 10, 12, 0).getTime();
212
200
  timeAgo.format(date, 'twitter', {
213
201
  now: now,
214
- getTimeToNextUpdate: true
215
- }).should.deep.equal(['Apr 10, 2018', // Updates on Jan 1st, 2018, 00:00.
216
- new Date(2018, 0, 1).getTime() - now]); // 1st, 2018, 00:00.
202
+ getTimeToNextUpdate: true,
203
+ getTimeToNextUpdateUncapped: true
204
+ }).should.deep.equal(['Apr 10, 2018',
205
+ // Updates on Jan 1st, 2018, 00:00.
206
+ new Date(2018, 0, 1).getTime() - now]);
217
207
 
208
+ // 1st, 2018, 00:00.
218
209
  now = new Date(2018, 0, 1).getTime();
219
210
  timeAgo.format(date, 'twitter', {
220
211
  now: now,
221
212
  getTimeToNextUpdate: true,
213
+ getTimeToNextUpdateUncapped: true,
222
214
  round: 'floor'
223
- }).should.deep.equal(['Apr 10', // Updates after April 9th, 2018, 12:00.
224
- new Date(2018, 3, 9, 12, 0).getTime() + 1 - now]); // After April 9th, 2018, 12:00.
215
+ }).should.deep.equal(['Apr 10',
216
+ // Updates after April 9th, 2018, 12:00.
217
+ new Date(2018, 3, 9, 12, 0).getTime() + 1 - now]);
225
218
 
219
+ // After April 9th, 2018, 12:00.
226
220
  now = new Date(2018, 3, 9, 12, 0).getTime() + 1;
227
221
  timeAgo.format(date, 'twitter', {
228
222
  now: now,
229
223
  getTimeToNextUpdate: true,
230
224
  round: 'floor'
231
- }).should.deep.equal(['23h', // Updates in an hour.
225
+ }).should.deep.equal(['23h',
226
+ // Updates in an hour.
232
227
  60 * 60 * 1000]);
233
228
  });
234
229
  it('should get time to next update (round: "round")', function () {
235
- var timeAgo = new TimeAgo('en'); // April 10th, 2018, 12:00.
230
+ var timeAgo = new TimeAgo('en');
236
231
 
232
+ // April 10th, 2018, 12:00.
237
233
  var date = new Date(2018, 3, 10, 12, 0);
238
- var now; // 1st, 2018, 00:00.
234
+ var now;
239
235
 
236
+ // 1st, 2018, 00:00.
240
237
  now = new Date(2018, 0, 1).getTime();
241
238
  timeAgo.format(date, 'twitter', {
242
239
  now: now,
243
- getTimeToNextUpdate: true
244
- }).should.deep.equal(['Apr 10', // Updates after April 9th, 2018, 11:30.
245
- new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1 - now]); // After April 9th, 2018, 12:00.
240
+ getTimeToNextUpdate: true,
241
+ getTimeToNextUpdateUncapped: true
242
+ }).should.deep.equal(['Apr 10',
243
+ // Updates after April 9th, 2018, 11:30.
244
+ new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1 - now]);
246
245
 
246
+ // After April 9th, 2018, 12:00.
247
247
  now = new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1;
248
248
  timeAgo.format(date, 'twitter', {
249
249
  now: now,
250
250
  getTimeToNextUpdate: true
251
- }).should.deep.equal(['23h', // Updates in an hour.
251
+ }).should.deep.equal(['23h',
252
+ // Updates in an hour.
252
253
  60 * 60 * 1000]);
253
254
  });
254
255
  });
@@ -1 +1 @@
1
- {"version":3,"file":"twitter.test.js","names":["twitter","TimeAgo","hour","minute","day","month","year","describe","it","timeAgo","format","Date","now","should","include","formatDatePastBy","secondsPassed","equal","round","getTime","test","time","result","date","getTimeToNextUpdate","deep"],"sources":["../../source/style/twitter.test.js"],"sourcesContent":["import twitter from './twitter.js'\r\nimport TimeAgo from '../TimeAgo.js'\r\nimport { hour, minute, day, month, year } from '../steps/index.js'\r\n\r\ndescribe('style/twitter', () => {\r\n\tit('should fallback from \"mini\" to \"narrow\"', () => {\r\n\t\tconst timeAgo = new TimeAgo('ccp')\r\n\t\ttimeAgo.format(Date.now() - 3 * hour * 1000, 'twitter').should.include(' ๐‘„Š๐‘„ฎ๐‘„š๐‘„ด๐‘„“ ๐‘„ƒ๐‘„‰๐‘„ฌ')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (round: \"round\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(-secondsPassed * 1000, { now: 0, ...twitter })\r\n\r\n\t\tformatDatePastBy(0.49).should.equal('0s')\r\n\t\tformatDatePastBy(0.5).should.equal('1s')\r\n\t\tformatDatePastBy(59.49).should.equal('59s')\r\n\t\tformatDatePastBy(59.5).should.equal('1m')\r\n\t\tformatDatePastBy(1.49 * minute).should.equal('1m')\r\n\t\tformatDatePastBy(1.5 * minute).should.equal('2m')\r\n\t\t// โ€ฆ\r\n\t\tformatDatePastBy(59.49 * minute).should.equal('59m')\r\n\t\tformatDatePastBy(59.5 * minute).should.equal('1h')\r\n\t\tformatDatePastBy(1.49 * hour).should.equal('1h')\r\n\t\tformatDatePastBy(1.5 * hour).should.equal('2h')\r\n\t\t// โ€ฆ\r\n\t\tformatDatePastBy(23.49 * hour).should.equal('23h')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(-secondsPassed * 1000, { now: 0, ...twitter, round: 'floor' })\r\n\r\n\t\tformatDatePastBy(0).should.equal('0s')\r\n\t\tformatDatePastBy(0.9).should.equal('0s')\r\n\t\tformatDatePastBy(1).should.equal('1s')\r\n\t\tformatDatePastBy(59.9).should.equal('59s')\r\n\t\tformatDatePastBy(60).should.equal('1m')\r\n\t\tformatDatePastBy(1.9 * minute).should.equal('1m')\r\n\t\tformatDatePastBy(2 * minute).should.equal('2m')\r\n\t\tformatDatePastBy(2.9 * minute).should.equal('2m')\r\n\t\tformatDatePastBy(3 * minute).should.equal('3m')\r\n\t\t// โ€ฆ\r\n\t\tformatDatePastBy(59.9 * minute).should.equal('59m')\r\n\t\tformatDatePastBy(60 * minute).should.equal('1h')\r\n\t\tformatDatePastBy(1.9 * hour).should.equal('1h')\r\n\t\tformatDatePastBy(2 * hour).should.equal('2h')\r\n\t\tformatDatePastBy(2.9 * hour).should.equal('2h')\r\n\t\tformatDatePastBy(3 * hour).should.equal('3h')\r\n\t\t// โ€ฆ\r\n\t\tformatDatePastBy(23.9 * hour).should.equal('23h')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (absolute dates)', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2016, 12:00.\r\n\t\tconst now = new Date(2016, 3, 10, 12, 0).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(day + 2 * minute + hour).should.equal('Apr 9')\r\n\t\t// โ€ฆ\r\n\t\t// `month` is about 30.5 days.\r\n\t\tformatDatePastBy(month * 3).should.equal('Jan 10')\r\n\t\tformatDatePastBy(month * 4).should.equal('Dec 10, 2015')\r\n\t\tformatDatePastBy(year).should.equal('Apr 11, 2015')\r\n\r\n\t\t// Test future dates.\r\n\t\t// `month` is about 30.5 days.\r\n\t\tformatDatePastBy(-1 * month * 8).should.equal('Dec 10')\r\n\t\tformatDatePastBy(-1 * month * 9).should.equal('Jan 9, 2017')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Russian)', () => {\r\n\t\tconst timeAgo = new TimeAgo('ru')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(0).should.equal('0 ั')\r\n\t\tformatDatePastBy(1).should.equal('1 ั')\r\n\t\tformatDatePastBy(minute).should.equal('1 ะผะธะฝ')\r\n\t\tformatDatePastBy(hour).should.equal('1 ั‡')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9 ะฐะฟั€.')\r\n\t\tformatDatePastBy(year).should.equal('11 ะฐะฟั€. 2015 ะณ.')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Korean)', () => {\r\n\t\tconst timeAgo = new TimeAgo('ko')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1๋ถ„')\r\n\t\tformatDatePastBy(hour).should.equal('1์‹œ๊ฐ„')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('4์›” 9์ผ')\r\n\t\tformatDatePastBy(year).should.equal('2015๋…„ 4์›” 11์ผ')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (German)', () => {\r\n\t\tconst timeAgo = new TimeAgo('de')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1 Min.')\r\n\t\tformatDatePastBy(hour).should.equal('1 Std.')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9. Apr.')\r\n\t\tformatDatePastBy(year).should.equal('11. Apr. 2015')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (French)', () => {\r\n\t\tconst timeAgo = new TimeAgo('fr')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1 min.')\r\n\t\tformatDatePastBy(hour).should.equal('1 h')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9 avr.')\r\n\t\tformatDatePastBy(year).should.equal('11 avr. 2015')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Chinese)', () => {\r\n\t\tconst timeAgo = new TimeAgo('zh')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1ๅˆ†้’Ÿ')\r\n\t\tformatDatePastBy(hour).should.equal('1ๅฐๆ—ถ')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('4ๆœˆ9ๆ—ฅ')\r\n\t\tformatDatePastBy(year).should.equal('2015ๅนด4ๆœˆ11ๆ—ฅ')\r\n\t})\r\n\r\n\t// This test won't pass because `Intl.DateTimeFormat` is read at\r\n\t// initialization time, not at run time.\r\n\t// it('should fall back to generic style when Intl.DateTimeFormat is not available', () => {\r\n\t// \tconst DateTimeFormat = Intl.DateTimeFormat\r\n\t// \tIntl.DateTimeFormat = undefined\r\n\t//\r\n\t// \tconst timeAgo = new TimeAgo('en')\r\n\t// \ttimeAgo.format(Date.now() - 365 * 24 * hour * 1000, 'twitter').should.equal('1yr')\r\n\t//\r\n\t// \tIntl.DateTimeFormat = DateTimeFormat\r\n\t// })\r\n\r\n\tit('should support timestamp argument on `yearMonthAndDay.test()`', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\t\ttimeAgo.format(0, 'twitter').should.equal('Jan 1, 1970')\r\n\t})\r\n\r\n\tit('should round as \"floor\"', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\t\tconst test = (time, result) => timeAgo.format(time, 'twitter', {\r\n\t\t\tround: 'floor',\r\n\t\t\tnow: 0\r\n\t\t}).should.equal(result)\r\n\t\ttest(2001, '2s')\r\n\t\ttest(2000, '2s')\r\n\t\ttest(1999, '1s')\r\n\t\ttest(1001, '1s')\r\n\t\ttest(1000, '1s')\r\n\t\ttest(999, '0s')\r\n\t\ttest(0, '0s')\r\n\t\ttest(-999, '0s')\r\n\t\ttest(-1000, '1s')\r\n\t\ttest(-1001, '1s')\r\n\t\ttest(-1999, '1s')\r\n\t\ttest(-2000, '2s')\r\n\t\ttest(-2001, '2s')\r\n\t})\r\n\r\n\tit('should get time to next update (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2018, 12:00.\r\n\t\tconst date = new Date(2018, 3, 10, 12, 0)\r\n\r\n\t\t// April 10th, 2016, 12:00 (two years earlier).\r\n\t\tlet now = new Date(2016, 3, 10, 12, 0).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10, 2018',\r\n\t\t\t// Updates on Jan 1st, 2018, 00:00.\r\n\t\t\tnew Date(2018, 0, 1).getTime() - now\r\n\t\t])\r\n\r\n\t\t// 1st, 2018, 00:00.\r\n\t\tnow = new Date(2018, 0, 1).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10',\r\n\t\t\t// Updates after April 9th, 2018, 12:00.\r\n\t\t\t(new Date(2018, 3, 9, 12, 0).getTime() + 1) - now\r\n\t\t])\r\n\r\n\t\t// After April 9th, 2018, 12:00.\r\n\t\tnow = new Date(2018, 3, 9, 12, 0).getTime() + 1\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'23h',\r\n\t\t\t// Updates in an hour.\r\n\t\t\t60 * 60 * 1000\r\n\t\t])\r\n\t})\r\n\r\n\tit('should get time to next update (round: \"round\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2018, 12:00.\r\n\t\tconst date = new Date(2018, 3, 10, 12, 0)\r\n\r\n\t\tlet now\r\n\r\n\t\t// 1st, 2018, 00:00.\r\n\t\tnow = new Date(2018, 0, 1).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10',\r\n\t\t\t// Updates after April 9th, 2018, 11:30.\r\n\t\t\t(new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1) - now\r\n\t\t])\r\n\r\n\t\t// After April 9th, 2018, 12:00.\r\n\t\tnow = new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'23h',\r\n\t\t\t// Updates in an hour.\r\n\t\t\t60 * 60 * 1000\r\n\t\t])\r\n\t})\r\n})"],"mappings":";;;;;;AAAA,OAAOA,OAAP,MAAoB,cAApB;AACA,OAAOC,OAAP,MAAoB,eAApB;AACA,SAASC,IAAT,EAAeC,MAAf,EAAuBC,GAAvB,EAA4BC,KAA5B,EAAmCC,IAAnC,QAA+C,mBAA/C;AAEAC,QAAQ,CAAC,eAAD,EAAkB,YAAM;EAC/BC,EAAE,CAAC,yCAAD,EAA4C,YAAM;IACnD,IAAMC,OAAO,GAAG,IAAIR,OAAJ,CAAY,KAAZ,CAAhB;IACAQ,OAAO,CAACC,MAAR,CAAe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AAO,GAAG,IAAIR,OAAJ,CAAY,IAAZ,CAAhB,CAD2D,CAG3D;;IACA,IAAMsB,IAAI,GAAG,IAAIZ,IAAJ,CAAS,IAAT,EAAe,CAAf,EAAkB,EAAlB,EAAsB,EAAtB,EAA0B,CAA1B,CAAb;IAEA,IAAIC,GAAJ,CAN2D,CAQ3D;;IACAA,GAAG,GAAG,IAAID,IAAJ,CAAS,IAAT,EAAe,CAAf,EAAkB,CAAlB,EAAqBQ,OAArB,EAAN;IAEAV,OAAO,CAACC,MAAR,CACCa,IADD,EAEC,SAFD,EAGC;MACCX,GAAG,EAAHA,GADD;MAECY,mBAAmB,EAAE;IAFtB,CAHD,EAOEX,MAPF,CAOSY,IAPT,CAOcR,KAPd,CAOoB,CACnB,QADmB,EAEnB;IACC,IAAIN,IAAJ,CAAS,IAAT,EAAe,CAAf,EAAkB,CAAlB,EAAqB,EAArB,EAAyB,CAAzB,EAA4BQ,OAA5B,KAAwC,KAAK,EAAL,GAAU,IAAlD,GAAyD,CAA1D,GAA+DP,GAH5C,CAPpB,EAX2D,CAwB3D;;IACAA,GAAG,GAAG,IAAID,IAAJ,CAAS,IAAT,EAAe,CAAf,EAAkB,CAAlB,EAAqB,EAArB,EAAyB,CAAzB,EAA4BQ,OAA5B,KAAwC,KAAK,EAAL,GAAU,IAAlD,GAAyD,CAA/D;IAEAV,OAAO,CAACC,MAAR,CACCa,IADD,EAEC,SAFD,EAGC;MACCX,GAAG,EAAHA,GADD;MAECY,mBAAmB,EAAE;IAFtB,CAHD,EAOEX,MAPF,CAOSY,IAPT,CAOcR,KAPd,CAOoB,CACnB,KADmB,EAEnB;IACA,KAAK,EAAL,GAAU,IAHS,CAPpB;EAYA,CAvCC,CAAF;AAwCA,CA5QO,CAAR"}
1
+ {"version":3,"file":"twitter.test.js","names":["twitter","TimeAgo","hour","minute","day","month","year","describe","it","timeAgo","format","Date","now","should","include","formatDatePastBy","secondsPassed","_objectSpread","equal","round","getTime","test","time","result","date","getTimeToNextUpdate","getTimeToNextUpdateUncapped","deep"],"sources":["../../source/style/twitter.test.js"],"sourcesContent":["import twitter from './twitter.js'\r\nimport TimeAgo from '../TimeAgo.js'\r\nimport { hour, minute, day, month, year } from '../steps/index.js'\r\n\r\ndescribe('style/twitter', () => {\r\n\tit('should fallback from \"mini\" to \"narrow\"', () => {\r\n\t\tconst timeAgo = new TimeAgo('ccp')\r\n\t\ttimeAgo.format(Date.now() - 3 * hour * 1000, 'twitter').should.include(' ๐‘„Š๐‘„ฎ๐‘„š๐‘„ด๐‘„“ ๐‘„ƒ๐‘„‰๐‘„ฌ')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (round: \"round\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(-secondsPassed * 1000, { now: 0, ...twitter })\r\n\r\n\t\tformatDatePastBy(0.49).should.equal('0s')\r\n\t\tformatDatePastBy(0.5).should.equal('1s')\r\n\t\tformatDatePastBy(59.49).should.equal('59s')\r\n\t\tformatDatePastBy(59.5).should.equal('1m')\r\n\t\tformatDatePastBy(1.49 * minute).should.equal('1m')\r\n\t\tformatDatePastBy(1.5 * minute).should.equal('2m')\r\n\t\t// โ€ฆ\r\n\t\tformatDatePastBy(59.49 * minute).should.equal('59m')\r\n\t\tformatDatePastBy(59.5 * minute).should.equal('1h')\r\n\t\tformatDatePastBy(1.49 * hour).should.equal('1h')\r\n\t\tformatDatePastBy(1.5 * hour).should.equal('2h')\r\n\t\t// โ€ฆ\r\n\t\tformatDatePastBy(23.49 * hour).should.equal('23h')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(-secondsPassed * 1000, { now: 0, ...twitter, round: 'floor' })\r\n\r\n\t\tformatDatePastBy(0).should.equal('0s')\r\n\t\tformatDatePastBy(0.9).should.equal('0s')\r\n\t\tformatDatePastBy(1).should.equal('1s')\r\n\t\tformatDatePastBy(59.9).should.equal('59s')\r\n\t\tformatDatePastBy(60).should.equal('1m')\r\n\t\tformatDatePastBy(1.9 * minute).should.equal('1m')\r\n\t\tformatDatePastBy(2 * minute).should.equal('2m')\r\n\t\tformatDatePastBy(2.9 * minute).should.equal('2m')\r\n\t\tformatDatePastBy(3 * minute).should.equal('3m')\r\n\t\t// โ€ฆ\r\n\t\tformatDatePastBy(59.9 * minute).should.equal('59m')\r\n\t\tformatDatePastBy(60 * minute).should.equal('1h')\r\n\t\tformatDatePastBy(1.9 * hour).should.equal('1h')\r\n\t\tformatDatePastBy(2 * hour).should.equal('2h')\r\n\t\tformatDatePastBy(2.9 * hour).should.equal('2h')\r\n\t\tformatDatePastBy(3 * hour).should.equal('3h')\r\n\t\t// โ€ฆ\r\n\t\tformatDatePastBy(23.9 * hour).should.equal('23h')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (absolute dates)', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2016, 12:00.\r\n\t\tconst now = new Date(2016, 3, 10, 12, 0).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(day + 2 * minute + hour).should.equal('Apr 9')\r\n\t\t// โ€ฆ\r\n\t\t// `month` is about 30.5 days.\r\n\t\tformatDatePastBy(month * 3).should.equal('Jan 10')\r\n\t\tformatDatePastBy(month * 4).should.equal('Dec 10, 2015')\r\n\t\tformatDatePastBy(year).should.equal('Apr 11, 2015')\r\n\r\n\t\t// Test future dates.\r\n\t\t// `month` is about 30.5 days.\r\n\t\tformatDatePastBy(-1 * month * 8).should.equal('Dec 10')\r\n\t\tformatDatePastBy(-1 * month * 9).should.equal('Jan 9, 2017')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Russian)', () => {\r\n\t\tconst timeAgo = new TimeAgo('ru')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(0).should.equal('0 ั')\r\n\t\tformatDatePastBy(1).should.equal('1 ั')\r\n\t\tformatDatePastBy(minute).should.equal('1 ะผะธะฝ')\r\n\t\tformatDatePastBy(hour).should.equal('1 ั‡')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9 ะฐะฟั€.')\r\n\t\tformatDatePastBy(year).should.equal('11 ะฐะฟั€. 2015 ะณ.')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Korean)', () => {\r\n\t\tconst timeAgo = new TimeAgo('ko')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1๋ถ„')\r\n\t\tformatDatePastBy(hour).should.equal('1์‹œ๊ฐ„')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('4์›” 9์ผ')\r\n\t\tformatDatePastBy(year).should.equal('2015๋…„ 4์›” 11์ผ')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (German)', () => {\r\n\t\tconst timeAgo = new TimeAgo('de')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1 Min.')\r\n\t\tformatDatePastBy(hour).should.equal('1 Std.')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9. Apr.')\r\n\t\tformatDatePastBy(year).should.equal('11. Apr. 2015')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (French)', () => {\r\n\t\tconst timeAgo = new TimeAgo('fr')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1 min.')\r\n\t\tformatDatePastBy(hour).should.equal('1 h')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('9 avr.')\r\n\t\tformatDatePastBy(year).should.equal('11 avr. 2015')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Chinese)', () => {\r\n\t\tconst timeAgo = new TimeAgo('zh')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatDatePastBy = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter })\r\n\r\n\t\tformatDatePastBy(minute).should.equal('1ๅˆ†้’Ÿ')\r\n\t\tformatDatePastBy(hour).should.equal('1ๅฐๆ—ถ')\r\n\t\tformatDatePastBy(day + 62 * minute).should.equal('4ๆœˆ9ๆ—ฅ')\r\n\t\tformatDatePastBy(year).should.equal('2015ๅนด4ๆœˆ11ๆ—ฅ')\r\n\t})\r\n\r\n\t// This test won't pass because `Intl.DateTimeFormat` is read at\r\n\t// initialization time, not at run time.\r\n\t// it('should fall back to generic style when Intl.DateTimeFormat is not available', () => {\r\n\t// \tconst DateTimeFormat = Intl.DateTimeFormat\r\n\t// \tIntl.DateTimeFormat = undefined\r\n\t//\r\n\t// \tconst timeAgo = new TimeAgo('en')\r\n\t// \ttimeAgo.format(Date.now() - 365 * 24 * hour * 1000, 'twitter').should.equal('1yr')\r\n\t//\r\n\t// \tIntl.DateTimeFormat = DateTimeFormat\r\n\t// })\r\n\r\n\tit('should support timestamp argument on `yearMonthAndDay.test()`', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\t\ttimeAgo.format(0, 'twitter').should.equal('Jan 1, 1970')\r\n\t})\r\n\r\n\tit('should round as \"floor\"', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\t\tconst test = (time, result) => timeAgo.format(time, 'twitter', {\r\n\t\t\tround: 'floor',\r\n\t\t\tnow: 0\r\n\t\t}).should.equal(result)\r\n\t\ttest(2001, '2s')\r\n\t\ttest(2000, '2s')\r\n\t\ttest(1999, '1s')\r\n\t\ttest(1001, '1s')\r\n\t\ttest(1000, '1s')\r\n\t\ttest(999, '0s')\r\n\t\ttest(0, '0s')\r\n\t\ttest(-999, '0s')\r\n\t\ttest(-1000, '1s')\r\n\t\ttest(-1001, '1s')\r\n\t\ttest(-1999, '1s')\r\n\t\ttest(-2000, '2s')\r\n\t\ttest(-2001, '2s')\r\n\t})\r\n\r\n\tit('should get time to next update (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2018, 12:00.\r\n\t\tconst date = new Date(2018, 3, 10, 12, 0)\r\n\r\n\t\t// April 10th, 2016, 12:00 (two years earlier).\r\n\t\tlet now = new Date(2016, 3, 10, 12, 0).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true,\r\n\t\t\t\tgetTimeToNextUpdateUncapped: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10, 2018',\r\n\t\t\t// Updates on Jan 1st, 2018, 00:00.\r\n\t\t\tnew Date(2018, 0, 1).getTime() - now\r\n\t\t])\r\n\r\n\t\t// 1st, 2018, 00:00.\r\n\t\tnow = new Date(2018, 0, 1).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true,\r\n\t\t\t\tgetTimeToNextUpdateUncapped: true,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10',\r\n\t\t\t// Updates after April 9th, 2018, 12:00.\r\n\t\t\t(new Date(2018, 3, 9, 12, 0).getTime() + 1) - now\r\n\t\t])\r\n\r\n\t\t// After April 9th, 2018, 12:00.\r\n\t\tnow = new Date(2018, 3, 9, 12, 0).getTime() + 1\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true,\r\n\t\t\t\tround: 'floor'\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'23h',\r\n\t\t\t// Updates in an hour.\r\n\t\t\t60 * 60 * 1000\r\n\t\t])\r\n\t})\r\n\r\n\tit('should get time to next update (round: \"round\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2018, 12:00.\r\n\t\tconst date = new Date(2018, 3, 10, 12, 0)\r\n\r\n\t\tlet now\r\n\r\n\t\t// 1st, 2018, 00:00.\r\n\t\tnow = new Date(2018, 0, 1).getTime()\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true,\r\n\t\t\t\tgetTimeToNextUpdateUncapped: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'Apr 10',\r\n\t\t\t// Updates after April 9th, 2018, 11:30.\r\n\t\t\t(new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1) - now\r\n\t\t])\r\n\r\n\t\t// After April 9th, 2018, 12:00.\r\n\t\tnow = new Date(2018, 3, 9, 12, 0).getTime() + 30 * 60 * 1000 + 1\r\n\r\n\t\ttimeAgo.format(\r\n\t\t\tdate,\r\n\t\t\t'twitter',\r\n\t\t\t{\r\n\t\t\t\tnow,\r\n\t\t\t\tgetTimeToNextUpdate: true\r\n\t\t\t}\r\n\t\t).should.deep.equal([\r\n\t\t\t'23h',\r\n\t\t\t// Updates in an hour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ACbc,IAAI,EACJ,SAAS,EACT;MACCZ,GAAG,EAAHA,GAAG;MACHa,mBAAmB,EAAE;IACtB,CACD,CAAC,CAACZ,MAAM,CAACc,IAAI,CAACT,KAAK,CAAC,CACnB,KAAK;IACL;IACA,EAAE,GAAG,EAAE,GAAG,IAAI,CACd,CAAC;EACH,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
@@ -1,16 +1,17 @@
1
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
-
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
-
5
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { minute } from '../steps/units.js';
8
8
  import twitter from './twitter.js';
9
9
  export default _objectSpread(_objectSpread({}, twitter), {}, {
10
10
  // Skip "seconds".
11
11
  steps: twitter.steps.filter(function (step) {
12
12
  return step.formatAs !== 'second';
13
- }) // Start showing `1m` from the first minute.
13
+ })
14
+ // Start showing `1m` from the first minute.
14
15
  .map(function (step) {
15
16
  return step.formatAs === 'minute' ? _objectSpread(_objectSpread({}, step), {}, {
16
17
  minTime: minute