{"_id":"tiny-relative-date","_rev":"9-609b391960a55434a34f8fe7b57c7374","name":"tiny-relative-date","dist-tags":{"latest":"2.0.2"},"versions":{"1.0.0":{"name":"tiny-relative-date","version":"1.0.0","author":{"url":"https://wildlyinaccurate.com/","name":"Joseph Wynn","email":"joseph@wildlyinaccurate.com"},"license":"MIT","_id":"tiny-relative-date@1.0.0","maintainers":[{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"}],"homepage":"https://github.com/wildlyinaccurate/relative-date#readme","bugs":{"url":"https://github.com/wildlyinaccurate/relative-date/issues"},"dist":{"shasum":"ad6642c443e02ba736ab76d122e34ddfb34007a1","tarball":"https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-1.0.0.tgz","integrity":"sha512-im2tgzJupnu7CaLofnEtUfFfRiyARf5E+B1rUVRuyBYn504DePzTeEsJM8C2WMQKYIOt1aL6GzpyeWUvkctYVg==","signatures":[{"sig":"MEYCIQC1wnlhG81BO3moU4VrPiunw1YfUDE1MqeuZQBkn75l0AIhAJR++DGwOqBuj6r4fJwP7RrQnJhdd29CaBzHYvAOM0py","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/relative-date.js","module":"src/relative-date.js","gitHead":"b15a32dd734c1a4c28ddbf68caebe016691f06fc","scripts":{"test":"npm run eslint && npm run jasmine","build":"babel src -d lib","eslint":"eslint --fix src/**/*.js","jasmine":"jasmine"},"_npmUser":{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"},"repository":{"url":"git+https://github.com/wildlyinaccurate/relative-date.git","type":"git"},"_npmVersion":"5.0.3","description":"Tiny function that provides relative, human-readable dates.","_nodeVersion":"8.1.2","devDependencies":{"eslint":"^4.1.0","jasmine":"^2.6.0","babel-cli":"^6.24.1","babel-register":"^6.24.1","eslint-plugin-node":"^5.0.0","babel-preset-es2015":"^6.24.1","eslint-plugin-import":"^2.6.0","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","babel-plugin-add-module-exports":"^0.2.1"},"_npmOperationalInternal":{"tmp":"tmp/tiny-relative-date-1.0.0.tgz_1498425119964_0.35619433387182653","host":"s3://npm-registry-packages"},"directories":{}},"1.0.1":{"name":"tiny-relative-date","version":"1.0.1","author":{"url":"https://wildlyinaccurate.com/","name":"Joseph Wynn","email":"joseph@wildlyinaccurate.com"},"license":"MIT","_id":"tiny-relative-date@1.0.1","maintainers":[{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"}],"homepage":"https://github.com/wildlyinaccurate/relative-date#readme","bugs":{"url":"https://github.com/wildlyinaccurate/relative-date/issues"},"dist":{"shasum":"93b0742c55f3126735b18f90ece76a61371d51a6","tarball":"https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-1.0.1.tgz","integrity":"sha512-oBmgSNUQYfIqmCn3LlNjVUOH5oOXYDu5mCzY0vGb7o3PHyLtHrhBzCLvpI4aa5ObMyShEHB49icGElC+eVKO2g==","signatures":[{"sig":"MEQCIBzgIGjxnWx1LZ1YLciD7fu/jVAfmvRuCoYFLcqlHROeAiBm0K00x/jhA6+Sf/PmXSKJDcqMeXiJoOGxhNT/6R0XcQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/relative-date.js","module":"src/relative-date.js","gitHead":"238c4c5282511e527f56cde9f585004ae2541067","scripts":{"test":"npm run eslint && npm run jasmine","build":"babel src -d lib","eslint":"eslint --fix src/**/*.js","jasmine":"jasmine","prepublish":"npm run build"},"_npmUser":{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"},"repository":{"url":"git+https://github.com/wildlyinaccurate/relative-date.git","type":"git"},"_npmVersion":"5.0.3","description":"Tiny function that provides relative, human-readable dates.","_nodeVersion":"8.1.2","devDependencies":{"eslint":"^4.1.0","jasmine":"^2.6.0","babel-cli":"^6.24.1","babel-register":"^6.24.1","eslint-plugin-node":"^5.0.0","babel-preset-es2015":"^6.24.1","eslint-plugin-import":"^2.6.0","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","babel-plugin-add-module-exports":"^0.2.1"},"_npmOperationalInternal":{"tmp":"tmp/tiny-relative-date-1.0.1.tgz_1498425771705_0.30926973931491375","host":"s3://npm-registry-packages"},"directories":{}},"1.0.2":{"name":"tiny-relative-date","version":"1.0.2","author":{"url":"https://wildlyinaccurate.com/","name":"Joseph Wynn","email":"joseph@wildlyinaccurate.com"},"license":"MIT","_id":"tiny-relative-date@1.0.2","maintainers":[{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"}],"homepage":"https://github.com/wildlyinaccurate/relative-date#readme","bugs":{"url":"https://github.com/wildlyinaccurate/relative-date/issues"},"dist":{"shasum":"3a69ffedcc841591746204a6bb5b1a7e2f084c63","tarball":"https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-1.0.2.tgz","integrity":"sha512-nbpzeb9iLkJQHhWblvbjMltEh2wl1Sq76rym1f5lWGKs2FZTbWySXA5Z/O03tv/hc4CI/tQSH1ZmT5rpDZB22g==","signatures":[{"sig":"MEQCIHdljb64kt39TjlSm9kfnlZZhREZOG5lCB8OLdnPfyK5AiBsPPbkFvQsuTGTMX7DRjZV0/awoEljnf9nNl/MmSsGdg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/relative-date.js","files":["lib/","src/","translations/"],"module":"src/relative-date.js","gitHead":"9ac536105400f1a56792992732a6b3966a2c5269","scripts":{"test":"npm run eslint && npm run jasmine","build":"babel src -d lib","eslint":"eslint --fix src/**/*.js","jasmine":"jasmine","prepublish":"npm run build"},"_npmUser":{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"},"repository":{"url":"git+https://github.com/wildlyinaccurate/relative-date.git","type":"git"},"_npmVersion":"5.0.4","description":"Tiny function that provides relative, human-readable dates.","_nodeVersion":"8.1.2","devDependencies":{"eslint":"^4.1.0","jasmine":"^2.6.0","babel-cli":"^6.24.1","babel-register":"^6.24.1","eslint-plugin-node":"^5.0.0","babel-preset-es2015":"^6.24.1","eslint-plugin-import":"^2.6.0","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","babel-plugin-add-module-exports":"^0.2.1"},"_npmOperationalInternal":{"tmp":"tmp/tiny-relative-date-1.0.2.tgz_1498836675676_0.5269380754325539","host":"s3://npm-registry-packages"},"directories":{}},"1.1.0":{"name":"tiny-relative-date","version":"1.1.0","author":{"url":"https://wildlyinaccurate.com/","name":"Joseph Wynn","email":"joseph@wildlyinaccurate.com"},"license":"MIT","_id":"tiny-relative-date@1.1.0","maintainers":[{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"}],"homepage":"https://github.com/wildlyinaccurate/relative-date#readme","bugs":{"url":"https://github.com/wildlyinaccurate/relative-date/issues"},"dist":{"shasum":"5377024abe5a7bbabdc65833c76d9e59c1fe1586","tarball":"https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-1.1.0.tgz","integrity":"sha512-GI5hZeay7HF083h4jJwnbwcstu3CAJf8XttkU8Apbo2Yg91lytoE8peuhUCGlZdWIJHOGByju33Z3LlWDxqJQQ==","signatures":[{"sig":"MEYCIQCAgQBVQmFUiwrxNEIxxkiHP0cxYuw6H/Qz2XeGWGH3DgIhAKGcMUtwkf+dIP+7huhPux5BEcaEeRzej7SHNBZaCime","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","files":["lib/","src/","translations/"],"module":"src/index.js","gitHead":"a4f49a3ba5cda31635c236c877840c6e1ca51016","scripts":{"test":"npm run eslint && npm run jasmine","build":"babel src -d lib","eslint":"eslint --fix src/**/*.js","jasmine":"jasmine","prepublish":"npm run build"},"_npmUser":{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"},"repository":{"url":"git+https://github.com/wildlyinaccurate/relative-date.git","type":"git"},"_npmVersion":"5.0.3","description":"Tiny function that provides relative, human-readable dates.","_nodeVersion":"8.1.2","devDependencies":{"eslint":"^4.1.0","jasmine":"^2.6.0","babel-cli":"^6.24.1","babel-register":"^6.24.1","eslint-plugin-node":"^5.0.0","babel-preset-es2015":"^6.24.1","eslint-plugin-import":"^2.6.0","eslint-plugin-promise":"^3.5.0","jasmine-spec-reporter":"^4.1.1","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","babel-plugin-add-module-exports":"^0.2.1"},"_npmOperationalInternal":{"tmp":"tmp/tiny-relative-date-1.1.0.tgz_1499002361316_0.08958010002970695","host":"s3://npm-registry-packages"},"directories":{}},"1.2.0":{"name":"tiny-relative-date","version":"1.2.0","author":{"url":"https://wildlyinaccurate.com/","name":"Joseph Wynn","email":"joseph@wildlyinaccurate.com"},"license":"MIT","_id":"tiny-relative-date@1.2.0","maintainers":[{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"}],"homepage":"https://github.com/wildlyinaccurate/relative-date#readme","bugs":{"url":"https://github.com/wildlyinaccurate/relative-date/issues"},"dist":{"shasum":"5ce7b7cda48cd5945eaeeead77df89c393f79220","tarball":"https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-1.2.0.tgz","integrity":"sha512-i/87NcNhGVxgJLKNcTjTADkZwETDoC39vWLZeOQL4aU4pljVump2NYGLVxGbj0vvwdF7mJGkvfVReIrqxqEd4Q==","signatures":[{"sig":"MEYCIQDxFFNYaI6hRhypHHR5dAJkLSIqQL1LtyKsWw0hzNHUVAIhAIVA0SWBdfDwrfa+FrAniqf9MBBmL8MjqloGvRPiFOu/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","files":["lib/","src/","translations/"],"module":"src/index.js","gitHead":"da1839fe883c39393c421aecc7692adc20a8c6ca","scripts":{"test":"npm run eslint && npm run jasmine","build":"babel src -d lib","eslint":"eslint --fix src/**/*.js","jasmine":"jasmine","prepublish":"npm run build"},"_npmUser":{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"},"repository":{"url":"git+https://github.com/wildlyinaccurate/relative-date.git","type":"git"},"_npmVersion":"5.3.0","description":"Tiny function that provides relative, human-readable dates.","_nodeVersion":"8.1.2","devDependencies":{"eslint":"^4.1.0","jasmine":"^2.6.0","babel-cli":"^6.24.1","babel-register":"^6.24.1","eslint-plugin-node":"^5.0.0","babel-preset-es2015":"^6.24.1","eslint-plugin-import":"^2.6.0","eslint-plugin-promise":"^3.5.0","jasmine-spec-reporter":"^4.1.1","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","babel-plugin-add-module-exports":"^0.2.1"},"_npmOperationalInternal":{"tmp":"tmp/tiny-relative-date-1.2.0.tgz_1500208708597_0.6640535483602434","host":"s3://npm-registry-packages"},"directories":{}},"1.3.0":{"name":"tiny-relative-date","version":"1.3.0","author":{"url":"https://wildlyinaccurate.com/","name":"Joseph Wynn","email":"joseph@wildlyinaccurate.com"},"license":"MIT","_id":"tiny-relative-date@1.3.0","maintainers":[{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"}],"homepage":"https://github.com/wildlyinaccurate/relative-date#readme","bugs":{"url":"https://github.com/wildlyinaccurate/relative-date/issues"},"dist":{"shasum":"fa08aad501ed730f31cc043181d995c39a935e07","tarball":"https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz","integrity":"sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A==","signatures":[{"sig":"MEUCIQDVonh575X6pbXWUVHx7AQnI/7zeKsYC3Z/4FhPGrN2/wIgIHzyv1vrXfx4pIFxWeicvsaAm+sTB3TfmQVz7JpjyFs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","files":["lib/","src/","translations/"],"module":"src/index.js","gitHead":"00c3910df6cb3fc4b8f3a0c97328f88fca71d630","scripts":{"test":"npm run eslint && npm run jasmine","build":"babel src -d lib","eslint":"eslint --fix src/**/*.js","jasmine":"jasmine","prepublish":"npm run build"},"_npmUser":{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"},"repository":{"url":"git+https://github.com/wildlyinaccurate/relative-date.git","type":"git"},"_npmVersion":"5.3.0","description":"Tiny function that provides relative, human-readable dates.","_nodeVersion":"8.1.2","devDependencies":{"eslint":"^4.1.0","jasmine":"^2.6.0","babel-cli":"^6.24.1","babel-register":"^6.24.1","eslint-plugin-node":"^5.0.0","babel-preset-es2015":"^6.24.1","eslint-plugin-import":"^2.6.0","eslint-plugin-promise":"^3.5.0","jasmine-spec-reporter":"^4.1.1","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","babel-plugin-add-module-exports":"^0.2.1"},"_npmOperationalInternal":{"tmp":"tmp/tiny-relative-date-1.3.0.tgz_1500210063893_0.5875307978130877","host":"s3://npm-registry-packages"},"directories":{}},"2.0.1":{"name":"tiny-relative-date","version":"2.0.1","author":{"url":"https://wildlyinaccurate.com/","name":"Joseph Wynn","email":"joseph@wildlyinaccurate.com"},"license":"MIT","_id":"tiny-relative-date@2.0.1","maintainers":[{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"}],"homepage":"https://github.com/wildlyinaccurate/relative-date#readme","bugs":{"url":"https://github.com/wildlyinaccurate/relative-date/issues"},"dist":{"shasum":"2832c49cca70580d06c15312f55d315eff7263ee","tarball":"https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-2.0.1.tgz","fileCount":18,"integrity":"sha512-FHu+pqmlca53V+4iFiuUKwV19EdTGdrTPb1K+xJToDlj0DCT2VMjJtKiRtdSCv9N3prKcc1aAyaVXJYh9xolrQ==","signatures":[{"sig":"MEUCIQCe33lZcAqqLkABg1Tj33dhlA7M7KFQh8sDOhKX6g36+gIgS0nIhd6+JuYDQAadN6X/3iXhq39N3WVqTUg9dGHVcs8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22768},"main":"lib/index.js","types":"./lib/index.d.ts","module":"src/index.js","gitHead":"f53ffe3042d6552288cc973d5797cfde92551338","scripts":{"test":"npm run eslint && npm run jasmine","build":"babel src -d lib && cp src/*.d.ts lib/","eslint":"eslint --fix src/**/*.js spec/*.js","jasmine":"TZ=UTC jasmine","prepublish":"npm run build"},"_npmUser":{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"},"repository":{"url":"git+https://github.com/wildlyinaccurate/relative-date.git","type":"git"},"_npmVersion":"11.3.0","description":"Tiny function that provides relative, human-readable dates.","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^4.19.1","jasmine":"^3.1.0","babel-cli":"^6.26.0","babel-register":"^6.26.0","eslint-plugin-node":"^6.0.1","babel-preset-es2015":"^6.24.1","eslint-plugin-import":"^2.11.0","eslint-plugin-promise":"^3.7.0","jasmine-spec-reporter":"^4.2.1","eslint-config-standard":"^11.0.0","eslint-plugin-standard":"^3.0.1","babel-plugin-add-module-exports":"^0.2.1"},"_npmOperationalInternal":{"tmp":"tmp/tiny-relative-date_2.0.1_1750128967893_0.23422995873075902","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"tiny-relative-date","version":"2.0.2","description":"Tiny function that provides relative, human-readable dates.","main":"lib/index.js","module":"src/index.js","scripts":{"build":"babel src -d lib && cp src/*.d.ts lib/","test":"npm run eslint && npm run jasmine","eslint":"eslint --fix src/**/*.js spec/*.js","jasmine":"TZ=UTC jasmine","prepublish":"npm run build"},"license":"MIT","author":{"name":"Joseph Wynn","email":"joseph@wildlyinaccurate.com","url":"https://wildlyinaccurate.com/"},"repository":{"type":"git","url":"git+https://github.com/wildlyinaccurate/relative-date.git"},"devDependencies":{"babel-cli":"^6.26.0","babel-plugin-add-module-exports":"^0.2.1","babel-preset-es2015":"^6.24.1","babel-register":"^6.26.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.7.0","eslint-plugin-standard":"^3.0.1","jasmine":"^3.1.0","jasmine-spec-reporter":"^4.2.1"},"_id":"tiny-relative-date@2.0.2","gitHead":"668f7a6c839aacb7ab5f52648bc5dd4916c3301a","types":"./lib/index.d.ts","bugs":{"url":"https://github.com/wildlyinaccurate/relative-date/issues"},"homepage":"https://github.com/wildlyinaccurate/relative-date#readme","_nodeVersion":"24.2.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-rGxAbeL9z3J4pI2GtBEoFaavHdO4RKAU54hEuOef5kfx5aPqiQtbhYktMOTL5OA33db8BjsDcLXuNp+/v19PHw==","shasum":"0c35c2a3ef87b80f311314918505aa86c2d44bc9","tarball":"https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-2.0.2.tgz","fileCount":18,"unpackedSize":22772,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC8jengeeh/Yd8Clkl126CRbrV29mGuihQJgwcpqxo7PAIgGvQ46dFWXmwKfqQuaypQZnQ3ncbFzJIuGE6xxuyxTg4="}]},"_npmUser":{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com","actor":{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com","type":"user"}},"directories":{},"maintainers":[{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tiny-relative-date_2.0.2_1750203907244_0.24059164500655883"},"_hasShrinkwrap":false}},"time":{"created":"2017-06-25T21:12:00.895Z","modified":"2025-06-17T23:45:07.583Z","1.0.0":"2017-06-25T21:12:00.895Z","1.0.1":"2017-06-25T21:22:52.698Z","1.0.2":"2017-06-30T15:31:16.681Z","1.1.0":"2017-07-02T13:32:42.186Z","1.2.0":"2017-07-16T12:38:29.490Z","1.3.0":"2017-07-16T13:01:06.740Z","2.0.1":"2025-06-17T02:56:08.062Z","2.0.2":"2025-06-17T23:45:07.405Z"},"bugs":{"url":"https://github.com/wildlyinaccurate/relative-date/issues"},"author":{"name":"Joseph Wynn","email":"joseph@wildlyinaccurate.com","url":"https://wildlyinaccurate.com/"},"license":"MIT","homepage":"https://github.com/wildlyinaccurate/relative-date#readme","repository":{"type":"git","url":"git+https://github.com/wildlyinaccurate/relative-date.git"},"description":"Tiny function that provides relative, human-readable dates.","maintainers":[{"name":"wildlyinaccurate","email":"joseph@wildlyinaccurate.com"}],"readme":"<h1><sup><small>(Tiny)</small></sup> Relative Date</h1>\n\nTiny function that provides relative, localised, human-readable dates.\n\n![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/tiny-relative-date.svg?style=for-the-badge)\n![Monthly Downloads](https://img.shields.io/npm/dm/tiny-relative-date.svg?style=for-the-badge)\n![Build Status](https://img.shields.io/travis/wildlyinaccurate/tiny-relative-date.svg?style=for-the-badge)\n\n## Installation\n\n```\nnpm install tiny-relative-date\n```\n\n## Usage\n\nThe module returns a `relativeDate` function with English translations by default.\n\n```js\nconst relativeDate = require('tiny-relative-date')\n```\n\nThe `relativeDate` function accepts date strings or `Date` objects.\n\n```js\nrelativeDate('2017-06-25 09:00') // '12 hours ago'\nrelativeDate(new Date()) // 'just now'\n```\n\nThe value of \"now\" can also be passed as a second parameter.\n\n```js\nconst now = new Date('2017-06-25 08:00:00')\nconst date = new Date('2017-06-25 07:00:00')\n\nrelativeDate(date, now) // 'an hour ago'\n```\n\n### Using a non-English locale\n\nThe tiny-relative-date module can be initialised with a locale. See the [translations directory](./translations) for a list of available locales.\n\n```js\nconst relativeDateFactory = require('tiny-relative-date/lib/factory')\nconst deTranslations = require('tiny-relative-date/translations/de')\nconst relativeDate = relativeDateFactory(deTranslations)\n\nrelativeDate(new Date()) // 'gerade eben'\n```\n\n### Using a custom locale\n\nYou can also use a completely custom locale by passing a translations object instead of a locale string. Translations can be plain strings with a `{{time}}` placeholder, or they can be functions. See the **Adding new locales** section below for a list of translation keys.\n\n```js\nconst relativeDateFactory = require('tiny-relative-date/lib/factory')\nconst relativeDate = relativeDateFactory({\n  hoursAgo: '{{time}}h ago',\n  daysAgo: (days) => `${days * 24}h ago`\n})\n\nrelativeDate('2017-06-25 07:00:00') // '2h ago'\nrelativeDate('2017-06-24 06:00:00') // '27h ago'\n```\n\n## Contributing\n\nContributions are welcome! Running this project locally requires Git and Node.js.\n\n```\ngit clone git@github.com:wildlyinaccurate/tiny-relative-date.git\ncd tiny-relative-date/\nnpm install\n```\n\nOnce you are set up, you can make changes to files in the `src/`, `spec/` and `translations/` directories. Build any changes you make by running\n\n```\nnpm run build\n```\n\nAnd run the tests with\n\n```\nnpm run test\n```\n\n### Adding new locales\n\nIf you would like to add a new locale, please create a JSON file in the `translations` directory and ensure it has the following keys:\n\n| Key                    | Default value (\"en\" locale) |\n|------------------------|-----------------------------|\n| `justNow`             | just now                    |\n| `secondsAgo`          | {{time}} seconds ago        |\n| `aMinuteAgo`         | a minute ago                |\n| `minutesAgo`          | {{time}} minutes ago        |\n| `anHourAgo`          | an hour ago                 |\n| `hoursAgo`            | {{time}} hours ago          |\n| `aDayAgo`            | yesterday                   |\n| `daysAgo`             | {{time}} days ago           |\n| `aWeekAgo`           | a week ago                  |\n| `weeksAgo`            | {{time}} weeks ago          |\n| `aMonthAgo`          | a month ago                 |\n| `monthsAgo`           | {{time}} months ago         |\n| `aYearAgo`           | a year ago                  |\n| `yearsAgo`            | {{time}} years ago          |\n| `overAYearAgo`      | over a year ago             |\n| `secondsFromNow`     | {{time}} seconds from now   |\n| `aMinuteFromNow`    | a minute from now           |\n| `minutesFromNow`     | {{time}} minutes from now   |\n| `anHourFromNow`     | an hour from now            |\n| `hoursFromNow`       | {{time}} hours from now     |\n| `aDayFromNow`       | tomorrow                    |\n| `daysFromNow`        | {{time}} days from now      |\n| `aWeekFromNow`      | a week from now             |\n| `weeksFromNow`       | {{time}} weeks from now     |\n| `aMonthFromNow`     | a month from now            |\n| `monthsFromNow`      | {{time}} months from now    |\n| `aYearFromNow`      | a year from now             |\n| `yearsFromNow`       | {{time}} years from now     |\n| `overAYearFromNow` | over a year from now        |\n","readmeFilename":"README.md"}