{"_id":"@bluemarblepayroll/time-ago-in-words","_rev":"8-574d45d83837f9b99a77d843432ea166","name":"@bluemarblepayroll/time-ago-in-words","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.1":{"name":"@bluemarblepayroll/time-ago-in-words","version":"1.0.1","description":"Localizable relative time resolver","main":"./dist/time_ago.js","typings":"./dist/time_ago.d.ts","directories":{"lib":"lib","test":"test"},"engines":{"node":">=8.11.3"},"contributors":[{"name":"Matthew Ruggio","email":"mruggio@bluemarblepayroll.com"}],"keywords":["time-ago-in-words","time","date","datetime","time-ago"],"scripts":{"test":"mocha --reporter spec","build":"tsc"},"repository":{"type":"git","url":"git+https://github.com/bluemarblepayroll/time-ago-in-words.git"},"bugs":{"url":"https://github.com/bluemarblepayroll/time-ago-in-words/issues"},"author":{"name":"Blue Marble Payroll, LLC"},"license":"MIT","homepage":"https://bitbucket.org/bluemarble-ondemand/time-ago-in-words/src/master/","devDependencies":{"chai":"^4.1.2","mocha":"^5.2.0","typescript":"^2.9.2"},"gitHead":"dff73aa26c4d66a5401d9884cd80876f03ac0db2","_id":"@bluemarblepayroll/time-ago-in-words@1.0.1","_npmVersion":"6.2.0","_nodeVersion":"8.11.3","_npmUser":{"name":"mruggio","email":"mattruggio@icloud.com"},"dist":{"integrity":"sha512-8mZdM6azLVLCzgtl51V7xlXP7FzLd4c3nLrAuKt8Wj4ck2T71ZhQeOhbGNxb5Qd7awxzndA2cQyV4ZVXGJ2jLA==","shasum":"9d531213b10ed8d089316b0fc19bbd8a2616787b","tarball":"https://registry.npmjs.org/@bluemarblepayroll/time-ago-in-words/-/time-ago-in-words-1.0.1.tgz","fileCount":23,"unpackedSize":52899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYx/xCRA9TVsSAnZWagAAR/EP/2hu0Jklna/sa1AAZmqX\npteQe0HPDDDuIYqkGGqmykKKL6wJHXx3xFZP0knusesVYBkIkyJE6W+c/ucM\nAJtzTMYz/mOef0iH7Pj4bGjSqLljqN9JOAtv7fA31wLOxg8SyUaB9iOpELZ3\n/dLzLz2+mZnM68wTboU9vmL1wm0SbYnsHSVczXQyEzI5SnQbfFWfGQX2npkd\n0bfUpdzTIzDSBfH5XGR+0in4J6pbSK4KO5Xxc/72yFWjiz5UqdndKEjvyuKI\nx/skTNJyqcrfqBcY6tNrPXd8rHsrFdIn4IXrcxpCJJLzVUUQdC5su6UEbXfr\nt/GdsCtvzVknvh6XSWYLdz87ansIpnQFx0OWSJvE69xy82PFn68Ao5/ljklR\nwRqmrND+5oasQtIVKWt6QMeF27yODHw7SZBchiIRRUJVP2FYAlCrot0kRSV+\niCK4x1RlwDubyjx4+ppOJZ4xrAB4RkMnyoz0BjTGAO3XyQK9tSHyN6CwhDb5\niZVbJMhmzowMlXE+en3SpL9kxShFnA/YfF/nF6B5rHSbKWr3qTfBc7WNk68U\nF2GUG9++bti6AkBJNOOjd1soPSZghx6yM/cM5LsRGcyPHorJLCpYfEsw0SWx\n3Z3By82nHHIlR+LxxKTMXLc4dgUSjoV692GsLDuDGwOjO66RuxgY3Em4RRDW\nRdI4\r\n=VS3L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEMyviz+1oyizsTPURo7r/rwaIsc2079WbfN2cfI77CBAiEAnKCe0GDquL3tvh2Z9abzB8fHr94BCNftMi9E48E6/fc="}]},"maintainers":[{"name":"gerryster","email":"gerryster@gmail.com"},{"name":"mruggio","email":"mattruggio@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-ago-in-words_1.0.1_1533222897502_0.4676949358403606"},"_hasShrinkwrap":false},"2.0.0":{"name":"@bluemarblepayroll/time-ago-in-words","version":"2.0.0","description":"Localizable relative time resolver","main":"./dist/time_ago.js","typings":"./dist/time_ago.d.ts","directories":{"lib":"lib","test":"test"},"engines":{"node":">=8.11.3"},"contributors":[{"name":"Matthew Ruggio","email":"mruggio@bluemarblepayroll.com"}],"keywords":["time-ago-in-words","time","date","datetime","time-ago"],"scripts":{"test":"mocha -r ts-node/register --reporter spec test/**/*.spec.ts","build":"tsc","start":"tsc -w","lint":"tslint -c tslint.json '{lib,test}/**/*.ts'"},"repository":{"type":"git","url":"git+https://github.com/bluemarblepayroll/time-ago-in-words.git"},"bugs":{"url":"https://github.com/bluemarblepayroll/time-ago-in-words/issues"},"author":{"name":"Blue Marble Payroll, LLC"},"license":"MIT","homepage":"https://bitbucket.org/bluemarble-ondemand/time-ago-in-words/src/master/","devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.5","chai":"^4.1.2","mocha":"^5.2.0","ts-node":"^7.0.1","tslint":"^5.11.0","typescript":"^2.9.2"},"gitHead":"66fce42e6c5369e9e3b919dc15974df8361f2aeb","_id":"@bluemarblepayroll/time-ago-in-words@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.11.3","_npmUser":{"name":"mruggio","email":"mattruggio@icloud.com"},"dist":{"integrity":"sha512-Dt7VaIazAY3f+BPHPi8A0gyyLRtKOPsfet7aYLUIXyC9QIcstV1Ir2ZHrHzIkOahrHF6JhgvOYR0xTqsKrhbag==","shasum":"b5b31023a4e15ecde32a3cfdcd6a6f382532ea63","tarball":"https://registry.npmjs.org/@bluemarblepayroll/time-ago-in-words/-/time-ago-in-words-2.0.0.tgz","fileCount":25,"unpackedSize":68049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb20hVCRA9TVsSAnZWagAA10UP/igx76tvdI76Yxnhv1fC\nAOMM0JKygeeZDPYek4fdeiTqjLrWXVxONLCKdtV3It1ZaJ3vYg/WcBqwn9yD\nPTTYqAA5PrOKd7m1T12fEfZOt0/J0JNiWMZsrx7QI/BgQrBNpWH1PZaLwOFN\nmJEIaUVetENWyUcWuLDQ+9zXdqUdiLupPYSb7FC2eri84QbyJxB3nmUaKk4x\nWhPP57Ft4TAY0Xs9qTV8575bYJwz1BYezcP8oeSdL2cXmEXzb1BYIM9Hnzt0\ngZjjCgXLErqY+LJautOs0n4Gj0MWXRlkyfsILhxHOBH8dqCnN3bW+EyHNLhG\n/uzTO6ljopcyIy2ZEDjGuGJ3fK9SjyIEzdo4w7lLx+dnfH0bmqhFU/VtBjmZ\n+/CGezx4pAU6v8u0XU3Ou6XabKIqctS+pMoEXhugZ61Tap46JTV4Hua/tG5O\n/2e9gxb0Rms6rhk4Dlsu7Pdv5QN+rysBxxw19hTQa7jCH8467B26DK2uxa3b\nEdABl3wCdg31xI5r5aseBf3aALRDN4xU71yIdpzVP2jwdO/1YseHkJabonOy\nVnr/fvm9Mq7mckfxpNerpdCKtAyFZ2H09fEHA0H2CbQ1rqwAFoMpTY3PvULf\nZhMJ2z74FcctF4RRKazinSdBRY6z2llLHwh4k7z1SSlxD+N/EdBp+SqeA9sg\nkrJN\r\n=EUY1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrpq8Jy5ZjIj1PPeJVWgiCARd0m0ry/ZLatlt9qvxY3wIgJ7iVqwlu3KBBXKNxbRH5m/5iiSGQD7V9kX9VUNsQwto="}]},"maintainers":[{"name":"gerryster","email":"gerryster@gmail.com"},{"name":"mruggio","email":"mattruggio@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-ago-in-words_2.0.0_1541097556924_0.7181100394322664"},"_hasShrinkwrap":false}},"time":{"created":"2018-08-02T15:14:57.262Z","1.0.1":"2018-08-02T15:14:57.616Z","modified":"2022-05-26T16:10:51.757Z","2.0.0":"2018-11-01T18:39:17.097Z"},"maintainers":[{"email":"jbosko@paylocity.com","name":"jbos"},{"email":"rbenyoseph@paylocity.com","name":"roeyb"},{"email":"jefflunt@gmail.com","name":"normalocity"},{"email":"ckattner@paylocity.com","name":"ckattnerpcty"}],"description":"Localizable relative time resolver","homepage":"https://bitbucket.org/bluemarble-ondemand/time-ago-in-words/src/master/","keywords":["time-ago-in-words","time","date","datetime","time-ago"],"repository":{"type":"git","url":"git+https://github.com/bluemarblepayroll/time-ago-in-words.git"},"contributors":[{"name":"Matthew Ruggio","email":"mruggio@bluemarblepayroll.com"}],"author":{"name":"Blue Marble Payroll, LLC"},"bugs":{"url":"https://github.com/bluemarblepayroll/time-ago-in-words/issues"},"license":"MIT","readme":"# Time Ago In Words\n\n**Localizable relative time resolver**\n\n[![Build Status](https://travis-ci.org/bluemarblepayroll/time-ago-in-words.svg?branch=master)](https://travis-ci.org/bluemarblepayroll/time-ago-in-words)\n\nThis library lets you easily convert a JavaScript Date object to a relative time span description.  For example, let's say the\ncurrent date and time is January 1, 2018 12:00:00 PM, then January 10, 2018 12:00:00 PM would resolve to: *in 9 days*.  More general examples:\n\n| Date/Time                       | Relative Description |\n| ------------------------------- | -------------------- |\n| January 1, 2016 12:00:00 PM)    | 2 years ago          |\n| November 1, 2018 12:00:00 PM)   | 2 months ago         |\n| December 30, 2017 12:00:00 PM)  | 2 days ago           |\n| January 1, 2018 4:00:00 AM)     | 8 hours ago          |\n| January 1, 2018 11:00:00 AM)    | 1 hour ago           |\n| January 1, 2018 11:50:00 AM)    | 10 minutes ago       |\n| January 1, 2018 11:58:00 AM)    | 2 minutes ago        |\n| January 1, 2018 11:59:01 AM)    | a minute ago         |\n| January 1, 2018 12:00:01 PM)    | in a minute          |\n| January 1, 2018 12:02:00 PM)    | in 2 minutes         |\n| January 1, 2018 12:10:00 PM)    | in 10 minutes        |\n| January 1, 2018 1:00:00 PM)     | in 1 hour            |\n| January 1, 2018 8:00:00 PM)     | in 8 hours           |\n| January 3, 2018 12:00:00 PM)    | in 2 days            |\n| April 1, 2018 12:00:00 PM)      | in 2 months          |\n| January 1, 2020 12:00:00 PM)    | in 2 years           |\n\nAnother important feature of this library is its ability to localize any of the relative expressions.  See examples below for more information.\n\n## Credit\n\nRail's time_ago_in_words along with (this gist)[https://gist.github.com/boxnos/5896114] helped inspire this library's API and internal implementation.\n\n## Installation\n\nThis library could be consumed as either a pure TypeScript library or as its trans-compiled ES2015 JavaScript counterpart.\n\nTo install through NPM:\n\n````\nnpm install --save @bluemarblepayroll/time-ago-in-words\n````\n\nTo install through Yarn:\n\n````\nyarn add @bluemarblepayroll/time-ago-in-words\n````\n\n## Examples\n\n### A Basic Example\n\nSuppose you just want to get the relative time between a Date and now (in our case lets use January 1, 2018 12:00:00 PM):\n\n````\nimport { timeAgoInWords } from '@bluemarblepayroll/time-ago-in-words';\n\nlet from = new Date(2017, 11, 31, 23); # December 31, 2017 11:00:00 PM\n\nlet value = timeAgoInWords(from); # \"13 hours ago\"\n````\n\nIt also works for future times as well:\n\n````\nlet from = new Date(2020, 0, 1, 12); # January 1, 2020 12:00:00 PM\n\nlet value = timeAgoInWords(from); # \"in 2 years\"\n````\n\n### Explicit Time Span Example\n\nYou can also pass in each part of the time span (from and to).  Using the above examples, respectively, would become:\n\n````\nlet from = new Date(2017, 11, 31, 23); # December 31, 2017 11:00:00 PM\nlet to = new Date(2018, 0, 1, 12); # January 1, 2018 12:00:00 PM\n\nlet value = timeAgoInWords(from, to); # \"13 hours ago\"\n````\n\n````\nlet from = new Date(2020, 0, 1, 12); # January 1, 2020 12:00:00 PM\nlet to = new Date(2018, 0, 1, 12); # January 1, 2018 12:00:00 PM\n\nlet value = timeAgoInWords(from, to); # \"in 2 years\"\n````\n\n### Custom Localization Example\n\nIt is also possible to define custom translations.  For all possible translations, see baseTranslations assignment within the file: ./lib/i18n.ts.\n\nBased on our previous examples, let's say we wanted to localize the following phrases:\n\n* \"%s hours ago\" => \"hace %s horas\"\n* \"in %s years\" => \"en %s años\"\n\nBased on our initial examples, respectively, we can achieve this like so:\n\n````\nimport { timeAgoSet } from '@bluemarblepayroll/time-ago-in-words';\n\ntimeAgoSet({ '%s hours ago': 'hace %s horas' });\n\nlet from = new Date(2017, 11, 31, 23); # December 31, 2017 11:00:00 PM\n\nlet value = timeAgoInWords(from); # \"hace 13 horas\"\n````\n\n````\nimport { timeAgoSet } from '@bluemarblepayroll/time-ago-in-words';\n\ntimeAgoSet({ 'in %s years': 'en %s años' });\n\nlet from = new Date(2020, 0, 1, 12); # January 1, 2020 12:00:00 PM\n\nlet value = timeAgoInWords(from); # \"en 2 años\"\n````\n\nIf you wish to revert back to default translations:\n\n````\nimport { timeAgoReset } from '@bluemarblepayroll/time-ago-in-words';\n\ntimeAgoReset();\n````\n\n## Contributing\n\n### Development Environment Configuration\n\nBasic steps to take to get this repository compiling:\n\n1. Install [Node.js](https://nodejs.org) (check package.json for versions supported.)\n2. Install Yarn package manager (npm install -g yarn)\n3. Clone the repository (git clone git@github.com:bluemarblepayroll/time-ago-in-words.git)\n4. Navigate to the root folder (cd time-ago-in-words)\n5. Install dependencies (yarn)\n\n### Compiling\n\nTo compile the TypeScript source down to native JavaScript, run:\n\n````\nyarn run build\n````\n\n### Running Tests\n\nTo execute the test suite run:\n\n````\nyarn run test\n````\n\n### Linting\n\n````\nyarn run lint\n````\n\n### Publishing\n\nNote: ensure you have proper authorization before trying to publish new versions.\n\nAfter code changes have successfully gone through the Pull Request review process then the following steps should be followed for publishing new versions:\n\n1. Merge Pull Request into master\n2. Update package.json [version number](https://semver.org/)\n3. Update CHANGELOG.md\n4. Push master to remote and ensure CI builds master successfully\n5. Build the project locally: `yarn run build`\n6. Perform a dry run: `npm publish --access public --dry-run`.  Inspect packaging, ensure all files (including dist) are included.\n7. Publish package to NPM: `npm publish --access public`\n8. Tag master with new version: `git tag <version>`\n9. Push tags remotely: `git push origin --tags`\n\n## License\n\nThis project is MIT Licensed.\n","readmeFilename":"README.md"}