Skip to content

Commit

Permalink
Migrate codebase to modern JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth committed Sep 30, 2022
1 parent 5edd54f commit 8162879
Show file tree
Hide file tree
Showing 59 changed files with 6,368 additions and 1,260 deletions.
40 changes: 0 additions & 40 deletions .blade.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests

on:
pull_request:
push:

jobs:
test:
name: JavaScript Test Action
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16, 18]

steps:
- uses: actions/checkout@master

- name: Setup Node v${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Yarn install
run: yarn install

- name: Run JavaScript Tests
run: yarn build

- name: Run JavaScript Tests
run: yarn test
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**3.0.0-beta.1** (September 30, 2022)

* Migrate Codebase to modern JavaScript [Marco Roth]

**2.1.0** (September 4, 2018)

* Add support for non-padded numerical strftime values (`%-d`, `%-m`, etc.) [Paco Benavent]
Expand Down
6 changes: 5 additions & 1 deletion MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2018 Javan Makhmali, Basecamp
Copyright 2022 Marco Roth

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -18,3 +18,7 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copyright for portions of project local-time are held by Javan Makhmali,
Basecamp 2018 as part of project local-time. All other copyright for
project @marcoroth/local-time are held by Marco Roth, 2022
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Local Time
# Modern Local Time

> This is a modern fork of Basecamp's `local-time` npm package and gem. The original repo can be found here: https://github.com/basecamp/local_time
Local 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.

## Installation

1. Add `gem 'local_time'` to your Gemfile.
2. Include `local-time.js` in your application's JavaScript bundle.

Using the asset pipeline:
```js
//= require local-time
```
Using the [local-time npm package](https://www.npmjs.com/package/local-time):
```js
import LocalTime from "local-time"
LocalTime.start()
```
2. Import `LocalTime` from [`@marcoroth/local-time`](https://www.npmjs.com/package/@marcoroth/local-time) in your application's JavaScript bundle.

```js
import LocalTime from "@marcoroth/local-time"

LocalTime.start()
```

## Example

Expand Down Expand Up @@ -140,8 +138,6 @@ LocalTime.config.i18n["es"] = {
LocalTime.config.locale = "es"
```

---
[![Build Status](https://travis-ci.org/basecamp/local_time.svg?branch=master)](https://travis-ci.org/basecamp/local_time)
## License

[![Sauce Test Status](https://saucelabs.com/browser-matrix/basecamp_local_time.svg)](https://saucelabs.com/u/basecamp_local_time)
Copyright © 2022 Marco Roth, Copyright © 2013-2018 Javan Makhmali, Basecamp. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
616 changes: 615 additions & 1 deletion app/assets/javascripts/local-time.js

Large diffs are not rendered by default.

Loading

0 comments on commit 8162879

Please sign in to comment.