
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
astro-github-time-elements
Advanced tools
An Astro wrapper for the '@github/time-elements' library for easy to use Date/Time components
This is a astro wrapper for the @github/time-elements library, it does a few things:
Date objects with the datetime prop<LocalTime>: creates it own date object by defaultnpm i astro-github-time-elements
---
import LocalTime from 'astro-github-time-elements';
---
<LocalTime date time/>
Output:
<local-time
datetime="2022-09-19T00:49:24.526Z"
year="numeric"
month="short"
day="numeric"
hour="2-digit"
minute="2-digit"
second="2-digit"
title="Sep 18, 2022, 7:49 PM CDT"
>
Sep 18, 2022 07:49:24 PM
</local-time>
Check out the @github/time-elements API to see how these components work, below are a few props added by this wrapper to make using the components a little bit easier
datetimeType: Date | string
Wrapper gives ability to use a Date for all components datetime prop
<LocalTime>datetimeDefault: new Date
If no datetime is defined for a <LocalTime> component it creates its own
dateType: booelan
A formating preset used to easily show a date without having to type out a format, adds the following attributes:
year="numeric"
month="short"
day="numeric"
Example:
<LocalTime date/> // Sep 18, 2022
timeType: booelan
A formatting preset used to easily show a time without having to type out a format, adds the following attributes:
hour="2-digit"
minute="2-digit"
second="2-digit"
Example:
<LocalTime time/> // 07:49:24 PM
<TimeUntil> && <TimeAgo>microType: booelan
Adds the attribute format="micro" to your element, shortens the descriptions to 1m, 1h, 1d, 1y
Example:
<TimeUntil datetime="2023-01-01T00:00:00.000Z"> // 'in 3 months'
<TimeUntil micro datetime="2023-01-01T00:00:00.000Z"> // '104d'
<LocalTime date/> // Sep 18, 2022
<LocalTime time/> // 09:40:34 PM
<LocalTime date time/> // Sep 18, 2022 09:40:34 PM
<RelativeTime datetime="2022-09-17T00:00:00.000Z" /> // 2 days ago
<TimeUntil datetime="2023-01-01T00:00:00.000Z"/> // in 3 months
<TimeUntil micro datetime="2023-01-01T00:00:00.000Z"/> // 104d
<TimeAgo datetime="2020-01-01T00:00:00.000Z"/> // 3 years ago
<TimeAgo micro datetime="2020-01-01T00:00:00.000Z"/> // 3y
Check out the @github/time-elements API for more help
FAQs
An Astro wrapper for the '@github/time-elements' library for easy to use Date/Time components
We found that astro-github-time-elements 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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.