🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@astro-github-elements/time

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astro-github-elements/time - npm Package Compare versions

Comparing version
0.1.0
to
0.1.1
+47
Time.astro
---
type Common = {
format: 'datetime'|'relative'|'duration';
tense?: 'auto'|'past'|'future';
precision?: 'year'|'month'|'day'|'hour'|'minute'|'second';
threshold?: string;
prefix?: string;
formatStyle?: 'long'|'short'|'narrow';
second?: 'numeric'|'2-digit';
minute?: 'numeric'|'2-digit';
hour?: 'numeric'|'2-digit';
weekday?: 'short'|'long'|'narrow';
day?: 'numeric'|'2-digit';
month?: 'numeric'|'2-digit'|'short'|'long'|'narrow';
year?: 'numeric'|'2-digit';
timeZoneName?: 'long'|'short'|'shortOffset'|'longOffset' |'shortGeneric'|'longGeneric';
}
type Truncate =
| { datetime: Date|string; }
| { now?: boolean; }
export type Props = Common & Truncate
const {
now,
datetime=now?(new Date):undefined,
formatStyle,
timeZoneName,
...attrs
} = Astro.props
---
<script>
import '@github/relative-time-element'
</script>
<relative-time
datetime={(datetime instanceof Date)?datetime.toISOString():datetime}
{...{
...attrs,
'format-style':formatStyle,
'time-zone-name':timeZoneName,
}}
>
<slot />
</relative-time>
+2
-2
{
"name": "@astro-github-elements/time",
"version": "0.1.0",
"version": "0.1.1",
"author": "Bryce Russell",

@@ -29,3 +29,3 @@ "license": "MIT",

"index.js",
"RelativeTime.astro"
"Time.astro"
],

@@ -32,0 +32,0 @@ "dependencies": {