https://github.com/bashleigh/shleemy-react
Date interval management for react
https://github.com/bashleigh/shleemy-react
Last synced: 12 months ago
JSON representation
Date interval management for react
- Host: GitHub
- URL: https://github.com/bashleigh/shleemy-react
- Owner: bashleigh
- License: mit
- Created: 2021-02-01T11:27:04.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-01T16:42:23.000Z (over 5 years ago)
- Last Synced: 2025-03-30T09:12:56.153Z (about 1 year ago)
- Language: TypeScript
- Size: 68.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Shleemy React
Wrapper for [shleemy](https://github.com/bashleigh/shleemy) interval factory
## Install
```bash
$ yarn add shleemy-react
```
## Usage
```tsx
import React from 'react';
import { Shleemy } from 'shleemy-react';
export const ItemRow = ({name, created, price}: {name: string, created: string, price: number}) => (
{name}
{price}
);
```
Outputs
name | price | 12 days ago
### Options
```tsx
`starting in ${value} ${ShleemyInterval.pluralInterval(value, interval)}`,
future: (value: number, interval: TimeIntervalLabel) => `created ${value} ${ShleemyInterval.pluralInterval(value, interval)} ago`,
}}
/>
```