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 34bbe20..4f835ae 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ If the browser's JavaScript is disabled, the default text served in the cached m
Available on [npm](https://www.npmjs.com/) as [**@github/relative-time-element**](https://www.npmjs.com/package/@github/relative-time-element).
```
-$ npm install @github/relative-time-element
+npm install @github/relative-time-element
```
This element uses the `Intl.DateTimeFormat` & `Intl.RelativeTimeFormat` APIs, which are supported by all modern JS engines. If you need to support an older browser, you may need to introduce a polyfill for `Intl.DateTimeFormat` & `Intl.RelativeTimeFormat`.
@@ -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` |
+| `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'`.
@@ -198,21 +199,21 @@ Precision can be used to limit the display of an `relative` or `duration` format
| `precision=` | format=duration |
|:-------------:|:-------------------:|
-| seconds | 2y 6m 10d 3h 20m 8s |
-| minutes | 2y 6m 10d 3h 20m |
-| hours | 2y 6m 10d 3h |
-| days | 2y 6m 10d |
-| months | 2y 6m |
-| years | 2y |
+| second | 2y 6m 10d 3h 20m 8s |
+| minute | 2y 6m 10d 3h 20m |
+| hour | 2y 6m 10d 3h |
+| day | 2y 6m 10d |
+| month | 2y 6m |
+| year | 2y |
| `precision=` | format=relative |
|:-------------:|:-------------------:|
-| seconds | 25 seconds |
-| minutes | now |
-| hours | now |
-| days | now |
-| months | now |
-| years | now |
+| second | 25 seconds |
+| minute | now |
+| hour | now |
+| day | now |
+| month | now |
+| year | now |
##### threshold (`string`, default: `P30D`)
@@ -268,6 +269,10 @@ For dates outside of the specified `threshold`, the formatting of the date can b
Lang is a [built-in global attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). Relative Time will use this to provide an applicable language to the `Intl` APIs. If the individual element does not have a `lang` attribute then it will traverse upwards in the tree to find the closest element that does, or default the lang to `en`.
+##### noTitle
+
+Adding the `no-title` attribute will remove the `title` attribute from the `Format DateTime
+ No title attribute:
+
Customised options:
Localised Dates
+ Lazily added datetime via setAttribute
+