@astro-github-elements/time
Advanced tools
+0
-2
@@ -19,3 +19,2 @@ --- | ||
| const { | ||
| class:className, | ||
| datetime=new Date, | ||
@@ -45,3 +44,2 @@ date, | ||
| <local-time | ||
| class:list={className} | ||
| datetime={(datetime instanceof Date)?datetime.toISOString():datetime} | ||
@@ -48,0 +46,0 @@ {...calc_attrs} |
+2
-2
| { | ||
| "name": "@astro-github-elements/time", | ||
| "version": "0.0.1", | ||
| "version": "0.0.2", | ||
| "author": "Bryce Russell", | ||
@@ -37,2 +37,2 @@ "license": "MIT", | ||
| } | ||
| } | ||
| } |
+9
-14
@@ -1,11 +0,10 @@ | ||
| # Astro Github Time Element | ||
| # `@astro-github-elements/time` | ||
| This is a astro wrapper for the [@github/time-elements](https://github.com/github/time-elements) library, it does a few things: | ||
| This is a astro wrapper for the [@github/time-elements](https://github.com/github/time-elements#readme) library, it does a few things: | ||
| - Makes importing components is easier | ||
| - Adds typing to props | ||
| - Ability to use `Date` objects with the `datetime` prop | ||
| - Adds typing to props | ||
| - `<LocalTime>`: creates it own date object by default | ||
| - Small API for adding attributes | ||
| - Classes use the `class:list` directive | ||
@@ -15,3 +14,3 @@ ## How to Use | ||
| ``` | ||
| npm i astro-github-time-elements | ||
| npm i @astro-github-elements/time | ||
| ``` | ||
@@ -22,3 +21,3 @@ | ||
| --- | ||
| import LocalTime from 'astro-github-time-elements'; | ||
| import { LocalTime } from '@astro-github-elements/time'; | ||
| --- | ||
@@ -47,4 +46,6 @@ | ||
| [Check out the @github/time-elements API](https://github.com/github/time-elements) to see how these components work, below are a few props added by this wrapper to make using the components a little bit easier | ||
| [Check out the @github/time-elements API](https://github.com/github/time-elements#readme) to see how these components work | ||
| Below are a few props added by this wrapper component to make the components a little bit easier to use | ||
| ### `datetime` | ||
@@ -56,8 +57,2 @@ | ||
| ### `class` | ||
| **Type**: `{} | [] | string` | ||
| All `class` props use the `class:list` directive for the ability to do class logic | ||
| ### `<LocalTime>` | ||
@@ -135,2 +130,2 @@ | ||
| [Check out the @github/time-elements API](https://github.com/github/time-elements) for more help | ||
| [Check out the @github/time-elements API](https://github.com/github/time-elements#readme) for more help |
@@ -9,3 +9,2 @@ --- | ||
| const { | ||
| class:className, | ||
| datetime, | ||
@@ -19,3 +18,2 @@ ...attrs | ||
| <relative-time | ||
| class:list={className} | ||
| datetime={(datetime instanceof Date)?datetime.toISOString():datetime} | ||
@@ -22,0 +20,0 @@ {...attrs} |
+0
-2
@@ -10,3 +10,2 @@ --- | ||
| const { | ||
| class:className, | ||
| datetime, | ||
@@ -26,3 +25,2 @@ micro, | ||
| <time-ago | ||
| class:list={className} | ||
| datetime={(datetime instanceof Date)?datetime.toISOString():datetime} | ||
@@ -29,0 +27,0 @@ {...calc_attrs} |
+0
-2
@@ -10,3 +10,2 @@ --- | ||
| const { | ||
| class:className, | ||
| datetime, | ||
@@ -26,3 +25,2 @@ micro, | ||
| <time-until | ||
| class:list={className} | ||
| datetime={(datetime instanceof Date)?datetime.toISOString():datetime} | ||
@@ -29,0 +27,0 @@ {...calc_attrs} |
6127
-4.88%126
-3.82%