{"_id":"local-time","_rev":"12-63ae2f111dd35bac08c5c95ea6ba7ee9","name":"local-time","dist-tags":{"latest":"3.0.3"},"versions":{"2.0.0":{"name":"local-time","version":"2.0.0","author":{"name":"Javan Makhmali","email":"javan@basecamp.com"},"license":"MIT","_id":"local-time@2.0.0","maintainers":[{"name":"javan","email":"javan@javan.us"}],"homepage":"https://github.com/basecamp/local_time","bugs":{"url":"https://github.com/basecamp/local_time/issues"},"dist":{"shasum":"af83c2a3685b096441c020895184eb6996e78d85","tarball":"https://registry.npmjs.org/local-time/-/local-time-2.0.0.tgz","integrity":"sha512-Y4i/qaCZ2dmmMmDveE0oWqW9mcDXh8B68pHaF41965TV8X+GqOftEdP8JVOcddFgMxTI1wQsMXL9WdyVZHqEaA==","signatures":[{"sig":"MEYCIQDU4Z/tQ/BaEho+z5E00OFF/GtqyoVZlJLHXiWvXjQffAIhAL8SKO+wuaWvmCE/hmDVu8eHYQeDDT38ONXUg0wUKd9B","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"app/assets/javascripts/local-time.js","files":["app/assets/javascripts/*.js"],"gitHead":"511d7a05a2b57d9151331366c895ca15a4180ada","_npmUser":{"name":"javan","email":"javan@javan.us"},"repository":{"url":"git+https://github.com/basecamp/local_time.git","type":"git"},"_npmVersion":"5.3.0","description":"Local <time> elements","directories":{},"_nodeVersion":"8.2.1","_npmOperationalInternal":{"tmp":"tmp/local-time-2.0.0.tgz_1502119509626_0.8685939703136683","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"local-time","version":"2.0.1","author":{"name":"Javan Makhmali","email":"javan@basecamp.com"},"license":"MIT","_id":"local-time@2.0.1","maintainers":[{"name":"javan","email":"javan@javan.us"}],"homepage":"https://github.com/basecamp/local_time","bugs":{"url":"https://github.com/basecamp/local_time/issues"},"dist":{"shasum":"99b987858b8bf1c41571237a4f42c16937db4c02","tarball":"https://registry.npmjs.org/local-time/-/local-time-2.0.1.tgz","fileCount":3,"integrity":"sha512-doon0/1vemXmICCHOrwy9jbc/PuO6id/WVJELLO8hLHMNurkrGdSVBltLdktKtTzCmPDDGtTDnqIbFax467cNg==","signatures":[{"sig":"MEUCIQD0R2VoQSdPxDnQaxtYHrhmGQW0R/qRfrlHDhNxVqbMmAIgYC1dgHfFrsR+976OSrnQE7wP34EEFg+w5aECODCKzmM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGEhnCRA9TVsSAnZWagAAD9oP/3FV0k3gXajfN0kXVWEw\n8WhHa3hEFYzihdAYTFgvIxLL+wYXQdl+uR4Bu6avPq/gWlCW8JyawqtkP1qH\nmkoO3MI4GFTiTXk02f/jNqCuL/1pjZta8+aPMe/1X4HtDkth84BBpwTEYm2/\nVV9S6RW/j9cmaRrATgssAOcdJCuqCnIhK/XMERjJaLvKiGrZKtInHKQhsNP3\nP4iu6QebHKWMRJtJW6zDB0CeP8DWW2/wO+YOMetofBfJGDu7ksug/TucjL39\n3/5c/A8sDiuIllU/dM/FLDb/R4dLkwCWffQ2e9w/cceQP5T/s210bN51OTLk\nL77Kew62oraARkzhy5LRkq5CpEIfmIoaBwvoygb7spTqwRh818GCKllybLUB\n1g8SE3QWpnmM8ngR+ZNiszBXofgwawbit7vvRAcZ4AOXqAHXOUsiVagndJoe\nVa84j0Af45Rui6xv47sWSUWzRaX0MIPkCyNsR5r+2WLljMk5ZlfqeL6DKwdU\nnZb9e6FY4w6PECn3bYsPFXHVDGh0N8eiuG3XViqJRMSPNYDrRUBCcbvdqRB1\n+lqHwRUQzDsMyrq2XhbbhgSizYz5y3Gc4hHHAiSt6+dCkF0yiMBpTE2pajLE\nARtJXTAcOZ5F86/xGBZvTqvSUXYk66IPKtXFwkUom9UOr6kpCc4bkhJrZxKq\nAT3f\r\n=jynq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"app/assets/javascripts/local-time.js","files":["app/assets/javascripts/*.js"],"gitHead":"531f9388c0fa56dc602f96093c9733758b0b59ee","_npmUser":{"name":"javan","email":"javan@javan.us"},"repository":{"url":"git+https://github.com/basecamp/local_time.git","type":"git"},"_npmVersion":"5.3.0","description":"Local <time> elements","directories":{},"_nodeVersion":"8.4.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/local-time_2.0.1_1528318053416_0.7699243693182278","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"local-time","version":"2.1.0","author":{"name":"Javan Makhmali","email":"javan@basecamp.com"},"license":"MIT","_id":"local-time@2.1.0","maintainers":[{"name":"javan","email":"javan@javan.us"}],"homepage":"https://github.com/basecamp/local_time","bugs":{"url":"https://github.com/basecamp/local_time/issues"},"dist":{"shasum":"be42f06bf269f9da77cb61ea722aa424dd01d919","tarball":"https://registry.npmjs.org/local-time/-/local-time-2.1.0.tgz","fileCount":4,"integrity":"sha512-4rB/8EkJIZ8O8Y5q536fSsRbzXOI0cL30l3ZKm4ISPC4D8jYOhRp/MpAaGKAYUvVIqkojT0c7kJk0RlnwtlR2w==","signatures":[{"sig":"MEQCIBZd70C7b/8S8HLnVNifzp5zD41bAqiMyEaKtSysb6VzAiAkLn5BrFiPJku3DpFcVYEQg3E1X9QdJ/+hJr+iPTutOA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjoVdCRA9TVsSAnZWagAAGr4QAJZKWtSctzFpflesJhKR\nbuhwlG12a+CBVPNz6tcwWsQZSdtuMFEys5rtsiZhg0NrkdaZDaZsl3ZCY4Qr\nX53lzpobeOiFhGVqumtoNpJBCfsbkMQ/+Qf3gTmPHM/9kXk1kOhY8g9Ah+kB\nLmIjLjjNQrXZVUL+5rqYFA1JFIVG8u89DVs+qL3UgYQkO8aMglerLOYZ137R\nTA795HZYv6MU/5cJJxR2XRl2Pm/0fzRWgW7TLzDFqIhogn7jgHUixTI3zF3v\nD/qfqVAVoDsLwYoxAEIvYGNWGy+2lktcTGSCgcOilY6Ay9bIykVIlDeLXVLJ\nNhRN+29EEwTPZ9iGlPaR87o4+r73hZKDFf+o76pRRtLj582IsVFIYxHM3t5G\nWhu50VdDqUu7MRA3jBY6DbIvNXomiTnOPswqcgk4qSzSd1Yr9NQ3JqIvhust\nTWKXbeIK+Ugj5P2DW5Oxf3I+2J0WBxwiJPZoyDx4Ut19eirF+/iTGrHaHN59\n4c8cwbGQPNsstsUZ/xZGhihoigxytCObli5NqDod8V4oEfnNH+jU2+6Ns6ZJ\n0hWCrMkF6DdYA2/4oiG+6b2+7aBUnJVBJOtlaY08PqdymxludhdIsArxCKcd\nop3d3S4RORieL2ByMj0UPVDCM3jMFXfCmDsODWMKI2vqSqYXesvWIVzvYaDF\nTu6j\r\n=9eVD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"app/assets/javascripts/local-time.js","gitHead":"5edd54f5e1e79bcb8e512ba1f89077241f55fc8c","_npmUser":{"name":"javan","email":"javan@javan.us"},"repository":{"url":"git+https://github.com/basecamp/local_time.git","type":"git"},"_npmVersion":"5.3.0","description":"Local <time> elements","directories":{},"_nodeVersion":"8.4.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/local-time_2.1.0_1536066909139_0.35600109438208527","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"local-time","version":"3.0.0","author":{"name":"Javan Makhmali","email":"javan@basecamp.com"},"license":"MIT","_id":"local-time@3.0.0","maintainers":[{"name":"javan","email":"javan@javan.us"},{"name":"bitsweat","email":"jeremydaer@gmail.com"},{"name":"dhh","email":"david@hey.com"},{"name":"josefarias","email":"jose@farias.mx"}],"homepage":"https://github.com/basecamp/local_time","bugs":{"url":"https://github.com/basecamp/local_time/issues"},"dist":{"shasum":"f363301f14d2e7bb88244f62f3b10c3ed4bea1a0","tarball":"https://registry.npmjs.org/local-time/-/local-time-3.0.0.tgz","fileCount":4,"integrity":"sha512-UIjRcuPgijcuuhGAIP7reWvRiWDStHTSf5ETWieHoAlItE20AyaKwD3NvCT6qYtfLTufMVBkR6t/piF5WGwAeQ==","signatures":[{"sig":"MEUCIQDocglkIGiiO8+rOb0GFNy9OX2EkD2DXRDjbtYbHW4TNwIgCvqiq9aMW+lHsSzibzMDbxhJNJRaYRV0rOXleivX4AM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26196},"main":"app/assets/javascripts/local-time.es2017-umd.js","module":"app/assets/javascripts/local-time.es2017-esm.js","gitHead":"40378769efc0abdccc352bb9feb70f0c24d15a7f","scripts":{"test":"yarn build && yarn start","build":"rollup -c","start":"node test/javascripts/server.mjs","watch":"rollup -wc"},"_npmUser":{"name":"josefarias","email":"jose@farias.mx"},"repository":{"url":"git+https://github.com/basecamp/local_time.git","type":"git"},"_npmVersion":"8.5.5","description":"Local <time> elements","directories":{},"_nodeVersion":"16.15.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.25.1","express":"^4.18.2","coffeescript":"^2.7.0","@rollup/plugin-alias":"^5.0.0","@rollup/plugin-terser":"^0.4.3","@rollup/plugin-node-resolve":"^15.1.0","rollup-plugin-coffee-script":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/local-time_3.0.0_1705346496671_0.14204143265363656","host":"s3://npm-registry-packages"}},"3.0.1":{"name":"local-time","version":"3.0.1","author":{"name":"Javan Makhmali","email":"javan@basecamp.com"},"license":"MIT","_id":"local-time@3.0.1","maintainers":[{"name":"javan","email":"javan@javan.us"},{"name":"bitsweat","email":"jeremydaer@gmail.com"},{"name":"dhh","email":"david@hey.com"},{"name":"josefarias","email":"jose@farias.mx"}],"homepage":"https://github.com/basecamp/local_time","bugs":{"url":"https://github.com/basecamp/local_time/issues"},"dist":{"shasum":"184e07330fe4a83462eb1af80ec1ba66fb6082fb","tarball":"https://registry.npmjs.org/local-time/-/local-time-3.0.1.tgz","fileCount":4,"integrity":"sha512-h9QtyRuNerGEwTEHKZbSgYT6GyabYcjxmMmeWmksosiy6JZgEeRSDeQjjgdvjE/A8T8bNjilhnF3OXlVAYKrCw==","signatures":[{"sig":"MEYCIQDrFUJPXZ/D164MCImlHpjOnQFKjexg0wLKDFRqW/kxmwIhAKQ53dWcKlwhBnANvBSETstrkkorYdqDUIPFoPKldcNP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26196},"main":"app/assets/javascripts/local-time.es2017-umd.js","module":"app/assets/javascripts/local-time.es2017-esm.js","gitHead":"196bceabfb41996abf16d33f059244401b7edb2d","scripts":{"test":"yarn build && yarn start","build":"rollup -c","start":"node test/javascripts/server.mjs","watch":"rollup -wc"},"_npmUser":{"name":"josefarias","email":"jose@farias.mx"},"repository":{"url":"git+https://github.com/basecamp/local_time.git","type":"git"},"_npmVersion":"8.5.5","description":"Local <time> elements","directories":{},"_nodeVersion":"16.15.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.25.1","express":"^4.18.2","coffeescript":"^2.7.0","@rollup/plugin-alias":"^5.0.0","@rollup/plugin-terser":"^0.4.3","@rollup/plugin-node-resolve":"^15.1.0","rollup-plugin-coffee-script":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/local-time_3.0.1_1705346669345_0.10066566844063463","host":"s3://npm-registry-packages"}},"3.0.2":{"name":"local-time","version":"3.0.2","author":{"name":"Javan Makhmali","email":"javan@basecamp.com"},"license":"MIT","_id":"local-time@3.0.2","maintainers":[{"name":"javan","email":"javan@javan.us"},{"name":"bitsweat","email":"jeremydaer@gmail.com"},{"name":"dhh","email":"david@hey.com"},{"name":"josefarias","email":"jose@farias.mx"}],"homepage":"https://github.com/basecamp/local_time","bugs":{"url":"https://github.com/basecamp/local_time/issues"},"dist":{"shasum":"2767a1f3a9310f445efe3d75ad3bd07f634fa5f0","tarball":"https://registry.npmjs.org/local-time/-/local-time-3.0.2.tgz","fileCount":4,"integrity":"sha512-22xNlCU10UxS+ecOtT2sLq17sVo0MQf8D2TvGEagS8Mi2gOtCIrY9cMfWH2dlkPLvEUmoWBfi8kzJNRoCSPvlg==","signatures":[{"sig":"MEYCIQC+A7RTt0QFYpsVzfhkF44S0lIqYCE1ZdVzDYtDWHGZgAIhANJ/Q94BuupPfZYDUjl86jVYwxuYQkWvfTeukaFAWtkS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26196},"main":"app/assets/javascripts/local-time.es2017-umd.js","module":"app/assets/javascripts/local-time.es2017-esm.js","gitHead":"fea9e0f58be6e9442a7d63657aff4eeffb3d8b09","scripts":{"test":"yarn build && yarn start","build":"rollup -c","start":"node test/javascripts/server.mjs","watch":"rollup -wc"},"_npmUser":{"name":"josefarias","email":"jose@farias.mx"},"repository":{"url":"git+https://github.com/basecamp/local_time.git","type":"git"},"_npmVersion":"8.5.5","description":"Local <time> elements","directories":{},"_nodeVersion":"16.15.0","_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.25.1","express":"^4.18.2","coffeescript":"^2.7.0","@rollup/plugin-alias":"^5.0.0","@rollup/plugin-terser":"^0.4.3","@rollup/plugin-node-resolve":"^15.1.0","rollup-plugin-coffee-script":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/local-time_3.0.2_1705346784623_0.9385845229163068","host":"s3://npm-registry-packages"}},"3.0.3":{"name":"local-time","version":"3.0.3","description":"Local <time> elements","module":"app/assets/javascripts/local-time.es2017-esm.js","main":"app/assets/javascripts/local-time.es2017-umd.js","repository":{"type":"git","url":"git+https://github.com/basecamp/local_time.git"},"author":{"name":"Javan Makhmali","email":"javan@basecamp.com"},"license":"MIT","bugs":{"url":"https://github.com/basecamp/local_time/issues"},"homepage":"https://github.com/basecamp/local_time","devDependencies":{"@rollup/plugin-alias":"^5.0.0","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","express":"^4.18.2","rollup":"^3.25.1"},"scripts":{"start":"node test/javascripts/server.mjs","build":"rollup -c","watch":"rollup -wc","test":"yarn build && yarn start"},"_id":"local-time@3.0.3","gitHead":"e3ca9fd7e87d076fe74bd9e6b7f7a88298964ca9","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-6z9YU1kIqNDhxmNA/ERu4C08XWyjI8guwBYUvkOJd6CbyO8b5hHJdh0UbCV7ZKj8tKjS3DZsRcbtwcNcH+MCdw==","shasum":"1738e7c224e562909b6d1f9aa1712bd9800cce7c","tarball":"https://registry.npmjs.org/local-time/-/local-time-3.0.3.tgz","fileCount":4,"unpackedSize":25200,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICWlnd9O1RgBS5Sfynw3Entujm5eZaUyaf4CYm+X1LoAAiBRoERSVgZbJZ3HHb8Mog6CGELheEh0Q1P2G2Jvh0hzRA=="}]},"_npmUser":{"name":"dmcbreen","email":"dmcbreen@gmail.com"},"directories":{},"maintainers":[{"name":"bitsweat","email":"jeremydaer@gmail.com"},{"name":"dhh","email":"david@hey.com"},{"name":"dmcbreen","email":"dmcbreen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/local-time_3.0.3_1741874289137_0.15602539938238968"},"_hasShrinkwrap":false}},"time":{"created":"2017-08-07T15:25:10.597Z","modified":"2025-03-13T13:58:09.547Z","2.0.0":"2017-08-07T15:25:10.597Z","2.0.1":"2018-06-06T20:47:33.494Z","2.1.0":"2018-09-04T13:15:09.299Z","3.0.0":"2024-01-15T19:21:36.845Z","3.0.1":"2024-01-15T19:24:29.509Z","3.0.2":"2024-01-15T19:26:24.809Z","3.0.3":"2025-03-13T13:58:09.352Z"},"bugs":{"url":"https://github.com/basecamp/local_time/issues"},"author":{"name":"Javan Makhmali","email":"javan@basecamp.com"},"license":"MIT","homepage":"https://github.com/basecamp/local_time","repository":{"type":"git","url":"git+https://github.com/basecamp/local_time.git"},"description":"Local <time> elements","maintainers":[{"name":"bitsweat","email":"jeremydaer@gmail.com"},{"name":"dhh","email":"david@hey.com"},{"name":"dmcbreen","email":"dmcbreen@gmail.com"}],"readme":"# Local Time\n\nLocal Time makes it easy to display times and dates to users in their local time. Its Rails helpers render `<time>` elements in UTC (making them cache friendly), and its JavaScript component immediately converts those elements from UTC to the browser's local time.\n\n## Installation\n\n### Importmaps\n1. Add `gem \"local_time\"` to your Gemfile.\n2. Run `bundle install`\n3. Run `bin/importmap pin local-time` to add the [local-time npm package](https://www.npmjs.com/package/local-time)\n4. Add this to `app/javascript/application.js`\n\n    ```js\n    import LocalTime from \"local-time\"\n    LocalTime.start()\n    document.addEventListener(\"turbo:morph\", () => {\n      LocalTime.run()\n    })\n    ```\n\n### Webpacker\n1. Add `gem \"local_time\"` to your Gemfile.\n2. Run `bundle install`\n3. Run `yarn add local-time`\n4. Add this to `app/javascript/packs/application.js`\n\n    ```js\n    import LocalTime from \"local-time\"\n    LocalTime.start()\n    ```\n\n## Example\n\n```ruby\n> comment.created_at\n\"Wed, 27 Nov 2013 18:43:22 EST -0500\"\n```\n\n```erb\n<%= local_time(comment.created_at) %>\n```\n\nRenders:\n\n```html\n<time data-format=\"%B %e, %Y %l:%M%P\"\n      data-local=\"time\"\n      datetime=\"2013-11-27T23:43:22Z\">November 27, 2013 11:43pm</time>\n```\n\nAnd is converted client-side to:\n\n```html\n<time data-format=\"%B %e, %Y %l:%M%P\"\n      data-local=\"time\"\n      datetime=\"2013-11-27T23:43:22Z\"\n      title=\"November 27, 2013 6:43pm EDT\"\n      data-localized=\"true\">November 27, 2013 6:43pm</time>\n```\n\n*(Line breaks added for readability)*\n\n## Time and date helpers\n\n```erb\n<%= local_time(time) %>\n```\n\nFormat with a strftime string (default format shown here)\n\n```erb\n<%= local_time(time, '%B %e, %Y %l:%M%P') %>\n```\n\nAlias for `local_time` with a month-formatted default\n\n```erb\n<%= local_date(time, '%B %e, %Y') %>\n```\n\nTo set attributes on the time tag, pass a hash as the second argument with a `:format` key and your attributes.\n\n```erb\n<%= local_time(time, format: '%B %e, %Y %l:%M%P', class: 'my-time') %>\n```\n\nTo use a strftime format already defined in your app, pass a symbol as the format.\n\n```erb\n<%= local_time(date, :long) %>\n```\n\nWhen using the `local_time` helper `I18n.t(\"time.formats.#{format}\")`, `I18n.t(\"date.formats.#{format}\")`, `Time::DATE_FORMATS[format]`, and `Date::DATE_FORMATS[format]` will be scanned (in that order) for your format.\n\nWhen using the `local_date` helper, `I18n.t(\"date.formats.#{format}\")`, `I18n.t(\"time.formats.#{format}\")`, `Date::DATE_FORMATS[format]`, and `Time::DATE_FORMATS[format]` will be scanned (in that order) for your format.\n\nNote: The included strftime JavaScript implementation is not 100% complete. It supports the following directives: `%a %A %b %B %c %d %e %H %I %l %m %M %p %P %S %w %y %Y %Z`\n\n## Time ago helpers\n\n```erb\n<%= local_time_ago(time) %>\n```\n\nDisplays the relative amount of time passed. With age, the descriptions transition from {quantity of seconds, minutes, or hours} to {date + time} to {date}. The `<time>` elements are updated every 60 seconds.\n\nExamples (in quotes):\n\n* Recent: \"a second ago\", \"32 seconds ago\", \"an hour ago\", \"14 hours ago\"\n* Yesterday: \"yesterday at 5:22pm\"\n* This week: \"Tuesday at 12:48am\"\n* This year: \"on Nov 17\"\n* Last year: \"on Jan 31, 2012\"\n\n## Relative time helpers\n\nPreset time and date formats that vary with age. The available types are `date`, `time-ago`, `time-or-date`, and `weekday`. Like the `local_time` helper, `:type` can be passed a string or in an options hash.\n\n```erb\n<%= local_relative_time(time, 'weekday') %>\n<%= local_relative_time(time, type: 'time-or-date') %>\n```\n\n**Available `:type` options**\n\n* `date` Includes the year unless it's current. \"Apr 11\" or \"Apr 11, 2013\"\n* `time-ago` See above. `local_time_ago` calls `local_relative_time` with this `:type` option.\n* `time-or-date` Displays the time if it occurs today or the date if not. \"3:26pm\" or \"Apr 11\"\n* `weekday` Displays \"Today\", \"Yesterday\", or the weekday (e.g. Wednesday) if the time is within a week of today.\n* `weekday-or-date` Displays the weekday if it occurs within a week or the date if not. \"Yesterday\" or \"Apr 11\"\n\n\n## Configuration\n\n**Internationalization (I18n)**\n\nLocal Time includes a [set of default `en` translations](lib/assets/javascripts/src/local-time/config/i18n.js) which can be updated directly. Or, you can provide an entirely new set in a different locale:\n\n```js\nLocalTime.config.i18n[\"es\"] = {\n  date: {\n    dayNames: [ … ],\n    monthNames: [ … ],\n    …\n  },\n  time: {\n    …\n  },\n  datetime: {\n    …\n  }\n}\n\nLocalTime.config.locale = \"es\"\n```\n\n> [!NOTE]\n> The \"default\" keys in the i18n configuration object are used for translations in LocalTime's `RelativeTime` module. They are not used to determine which format is rendered when none is provided. See https://github.com/basecamp/local_time/issues/128 for details.\n\n**24-hour time formatting**\nLocal Time supports 24-hour time formats out of the box.\n\nTo use this feature, configure the library to favor `data-format24` over `data-format` attributes:\n\n```js\nLocalTime.config.useFormat24 = true\n```\n\nThe library will now default to using the `data-format24` attribute on `<time>` elements for formatting.\nBut it will still fall back to `data-format` if `data-format24` is not provided.\n\nThe included Rails helpers will automatically look for 24h variants of named formats.\nThey will search for `#{name}_24h` in [the same places](#time-and-date-helpers) the regular name is looked up.\n\nThis is an example of what your app configuration might look like:\n\n```ruby\nTime::DATE_FORMATS[:simple] = \"%-l:%M%P\"\nTime::DATE_FORMATS[:simple_24h] = \"%H:%M\"\n```\n\nWhen `:type` is set to `time-ago`, the format is obtained from the `I18n` [configuration](#configuration).\n\nIn practice, you might set `config.useFormat24` to `true` or `false` depending on the current user's configuration, before rendering any `<time>` elements.\n\n## Contributing\nPlease read [CONTRIBUTING.md](./CONTRIBUTING.md).\n","readmeFilename":"README.md"}