
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@astro-github-elements/time
Advanced tools
An Astro wrapper for the '@github/relative-time-element' package
@astro-github-elements/timeThis is a astro wrapper for the @github/relative-time-element library, it does a few things:
Date objects with the datetime propnow propThis component lets the client decide how to render the date for more accessibility
npm i @astro-github-elements/time
---
import { Time } from '@astro-github-elements/time';
---
<Time format="datetime" now />
<Time format="datetime" datetime="2022-09-19T00:49:24.526Z" />
<Time format="relative" now />
<Time format="relative" datetime="2022-09-19T00:49:24.526Z" />
Output:
<relative-time datetime="2023-02-05T17:19:08.898Z" format="datetime" title="Feb 5, 2023, 11:19 AM CST">
Sun, Feb 5
</relative-time>
<relative-time datetime="2022-09-19T00:49:24.526Z" format="datetime" title="Sep 18, 2022, 7:49 PM CDT">
Sun, Sep 18, 2022
</relative-time>
<relative-time datetime="2023-02-05T17:20:43.371Z" format="relative" title="Feb 5, 2023, 11:20 AM CST">
now
</relative-time>
<relative-time datetime="2022-09-19T00:49:24.526Z" format="relative" title="Sep 18, 2022, 7:49 PM CDT">
on Sep 18, 2022
</relative-time>
The full API for this component can be viewed here: @github/relative-time-element
Below are a few tiny changes
formatFormat is required instead of defaulting to relative, this is so that there is only one component named <Time>
datetimeThe datetime prop can be either a Date or ISO string
This also means the date attribute is not included in props because it is redundant and is mostly for client side JavaScript
nowA new prop, shorthand for doing datetime={new Date}, do not use with the datetime prop
FAQs
An Astro wrapper for the '@github/relative-time-element' package
We found that @astro-github-elements/time demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.