1.0.4 • Published 4 years ago

react-time-convertor v1.0.4

Weekly downloads
27
License
-
Repository
github
Last release
4 years ago

react-time-convertor

Convert timestamps to human readable format quickly. steps to use this plugin given below. You can use it in ReactJS & ReactNative. No need to link in ReactNative.

NPM JavaScript Style Guide

Install

npm install --save react-time-convertor

New

ISO Date time support added. Pass ISO Date time in timestamp props.

Usage

It uses three props as timestamp, type, style and platform.

timestamp accepts timestamp as input e.g. 1575439866

type accepts chat | general | greet

style accepts styling for timestamp

platform accepts mobile (optional, only used in react-native)

while you're using type greet, no need to pass timestamp. It will return a wish string as Good Morning | Good Noon | Good Afternoon | Good Evening.

import React, { Component } from 'react'

import ReactTimeConvertor from 'react-time-convertor'

class Example extends Component {
  render () {
    return (
      <ReactTimeConvertor timestamp="1575439866" format="chat | general | greet" style={{color:'red'}} />
    )
  }
}

Usage (for react-native)

platform type mobile returns only string and must be used with <Text> in react-native.

...

import ReactTimeConvertor from 'react-time-convertor'

...
<Text>
   <ReactTimeConvertor timestamp="1575439866" format="chat | general | greet" platform = "mobile" />
   
</Text>

License

© reactunlimited

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago