Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #171

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ So, a relative date phrase is used for up to a month and then the actual date is

You can use `time-until` to always display a relative date that's in the future. It operates much like `<relative-time>`, except in the reverse, with past events shown as `just now` and future events always showing as relative:

- 10 years from now
- 20 days from now
- 6 hours from now
- 20 minutes from now
- 30 seconds from now
- in 10 years
- in 20 days
- in 6 hours
- in 20 minutes
- in 30 seconds
- just now

Add a `<time-until>` element to your markup. Provide a default formatted date as the element's text content (e.g. April 1, 2024).
Expand All @@ -82,6 +82,15 @@ Add a `<time-until>` element to your markup. Provide a default formatted date as
April 1, 2024
</time-until>
```
#### Micro format

The optional `format="micro"` attribute shortens the descriptions to 1m, 1h, 1d, 1y.

``` html
<time-until datetime="2012-04-01T16:30:00-08:00" format="micro">
April 1, 2014
</time-ago>
```

### time-ago

Expand Down