├── .gitignore ├── .rubocop.yml ├── .ruby-version ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Gemfile ├── Gemfile.lock ├── MIT-LICENSE ├── README.md ├── Rakefile ├── app ├── assets │ └── javascripts │ │ ├── local-time.es2017-esm.js │ │ └── local-time.es2017-umd.js └── helpers │ └── local_time_helper.rb ├── bin ├── release └── rubocop ├── lib ├── assets │ └── javascripts │ │ └── src │ │ └── local-time │ │ ├── calendar_date.js │ │ ├── config │ │ ├── format24.js │ │ ├── i18n.js │ │ ├── index.js │ │ ├── locale.js │ │ └── timer.js │ │ ├── controller.js │ │ ├── helpers │ │ ├── date_parse.js │ │ ├── dom.js │ │ ├── i18n.js │ │ ├── index.js │ │ └── strftime.js │ │ ├── index.js │ │ ├── local_time.js │ │ ├── page_observer.js │ │ ├── relative_time.js │ │ └── start.js ├── local_time.rb └── local_time │ └── version.rb ├── local_time.gemspec ├── package.json ├── rollup.config.mjs ├── test ├── helpers │ └── local_time_helper_test.rb └── javascripts │ ├── fixtures │ ├── index.html │ └── time_zone_check.html │ ├── server.mjs │ ├── src │ ├── format24_test.js │ ├── i18n_test.js │ ├── index.js │ ├── local_time_test.js │ ├── relative_date_test.js │ ├── strftime_test.js │ ├── test_helpers.js │ └── time_ago_test.js │ └── vendor │ ├── moment.js │ └── sinon.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | test/javascripts/builds/ 2 | /node_modules 3 | tmp/ 4 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | inherit_gem: { rubocop-37signals: rubocop.yml } 2 | 3 | require: rubocop-rake 4 | 5 | AllCops: 6 | TargetRubyVersion: 2.7 7 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.8 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | cache: bundler 3 | branches: 4 | only: 5 | - master 6 | before_install: 7 | - true && `base64 --decode <<< ZXhwb3J0IFNBVUNFX1VTRVJOQU1FPWJhc2VjYW1wX2xvY2FsX3RpbWUK` 8 | - true && `base64 --decode <<< ZXhwb3J0IFNBVUNFX0FDQ0VTU19LRVk9ZWM5Y2QyMjMtOTFjNS00NmRkLWJmNDktZWIyYmZiY2NjYzMzCg==` 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | **3.0.2** (January 15, 2024) 2 | 3 | * No changes, just a test release for the release script 4 | 5 | **3.0.1** (January 15, 2024) 6 | 7 | * Add ancillary files to release script 8 | * `Gemfile.lock` and `MIT-LICENSE` were modified by the release script but not committed to the repository as part of releasing. 9 | 10 | **3.0.0** (January 15, 2024) 11 | 12 | * Add processing indicators 13 | * `data-processed-at` attribute is added to processed elements 14 | * Disambiguate date and time formats 15 | * **Breaking change**: Named date formats declared in ruby are given preference when using date helpers. This is only breaking if you have a date format name that conflicts with a time format, and were expecting the time format to be chosen when using a date helper. See README for details. 16 | * Provided by @alesolano 17 | * Create release script 18 | * Process elements on repeated start calls 19 | * Calling `LocalTime.start()` multiple times will reprocess all elements 20 | * Leverage Intl.DateTimeFormat for time zone parsing 21 | * Time zone parsing with `%Z` is now done natively by the browser 22 | * Known edge cases not supported by the browser are accounted for separately 23 | * Previous mechanism still in place as a fallback 24 | * GMT offset displayed as a last resort 25 | * Add instructions for time zone testing to CONTRIBUTING.md 26 | * Revert "Add ARIA label to improve accessibility" 27 | * `