Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-npm-formatted-relative-date

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-npm-formatted-relative-date

A React project for displaying date in relative format i.g. 1 day ago

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

react-npm-formatted-relative-date

Basic React app. This project just aim to display relative date.

npm Version Build Status

Features

  • Display Realative date.
  • Runs in the browser and Node.js.
  • Built on standards.

Example

import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import FormattedRelativeDate from 'react-npm-formatted-relative-date';

class App extends Component {
	constructor(props){
		super(props);
	}

	render() {
		let myDate = new Date(2016,6,25);
		return(
			<div>
			<FormattedRelativeDate date={myDate} />
			</div>
		);
	}
}

ReactDOM.render(<App />,document.querySelector('.container'));

This example would render: relative date i.e. 3 days ago into the container element on the page.

Technology Stack:

  • react
  • mocha
  • react-intl

Usage:

Clone the repo as a new project:

git clone https://github.com/lobdev/react-npm-formatted-relative-date.git <formatted-relative-date>

Start Server:

First you have to replace the lib/component/formatted-relative-date.js to server.js in package.json
cd formatted-relative-date
npm i
npm start

Run App:

npm start command automatically initiate browser at 3000 port
http:://localhost:3000

Run tests:

cd formatted-relative-date
npm i
npm test

Developer Notes:

Make sure you configure your editor/IDE to use:

.editorconfig
.eslintrc

Keywords

FAQs

Package last updated on 02 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc