diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 20bebdd..26e8fd5 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
- node-version: 18
+ node-version: 22
registry-url: https://registry.npmjs.org/
cache: npm
- run: npm install -g npm@latest
@@ -29,15 +29,15 @@ jobs:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-github:
name: Publish to GitHub Packages
- runs-on: ubuntu-latest
- permissions:
+ runs-on: ubuntu-latest
+ permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
- node-version: 18
+ node-version: 22
registry-url: https://npm.pkg.github.com
cache: npm
scope: '@github'
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 20ee438..7a23343 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,7 +14,7 @@ jobs:
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
- node-version: 18.x
+ node-version: 22
- name: npm install, build, and test
run: |
npm it
diff --git a/README.md b/README.md
index 50704e2..4810707 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,7 @@ So, a relative date phrase is used for up to a month and then the actual date is
| `month` | `month` | `'numeric'\|'2-digit'\|'short'\|'long'\|'narrow'\|undefined` | *** |
| `year` | `year` | `'numeric'\|'2-digit'\|undefined` | **** |
| `timeZoneName` | `time-zone-name` | `'long'\|'short'\|'shortOffset'\|'longOffset'` `\|'shortGeneric'\|'longGeneric'\|undefined` | `undefined` |
+| `timeZone` | `time-zone` | `string\|undefined` | Browser default time zone |
| `noTitle` | `no-title` | `-` | `-` |
*: If unspecified, `formatStyle` will return `'narrow'` if `format` is `'elapsed'` or `'micro'`, `'short'` if the format is `'relative'` or `'datetime'`, otherwise it will be `'long'`.
@@ -139,6 +140,19 @@ The `duration` format will display the time remaining (or elapsed time) from the
- `4 hours`
- `8 days, 30 minutes, 1 second`
+##### time-zone (`string`)
+
+The`time-zone` attribute allows you to specify the IANA time zone name (e.g., `America/New_York`, `Europe/London`) used for formatting the date and time.
+
+You can set the time zone either as an attribute or property:
+```html
+
+ Lazily added datetime via setAttribute
+