An open API service indexing awesome lists of open source software.

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

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`,
}}
/>
```