react-time-limit

0.1.1 • Public • Published

react-time-limit

A React component to conditionally display elements based on date/time. Useful for displaying things like limited-time promotions so you don't have to redeploy or roll back your app on specific dates.

Installation

With Yarn:

yarn add react-time-limit

With npm:

npm install --save react-time-limit

Usage

import TimeLimit from 'react-time-limit'
 
...
 
<TimeLimit to='2018-01-20'>Show Before Target Date</TimeLimit>
<TimeLimit from='2018-01-20'>Show After Target Date</TimeLimit>
<TimeLimit from='2018-01-10' to='2018-01-15'>Show Between Two Target Dates</TimeLimit>

Dates can be supplied as any valid new Date value. (Date docs)

Readme

Keywords

Package Sidebar

Install

npm i react-time-limit

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • amadoa
  • dalewray
  • codevelopit
  • mastaaaron
  • escasports
  • tbaustin
  • ken85rose