npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-pure-time

v0.2.8

Published

React pure time component which format date and time

Downloads

611

Readme

react-pure-time npm package Build Status Dependency Status

React component which convert js date object, milliseconds to human readable format

Features

  • very small
  • UTC support
  • no external dependencies

Usage

import Time from 'react-pure-time';
<Time value="1990-06-16 13:22:17" format="d.m.Y H:i:s" />

Options

value: [string, number, instanceOf(Date)]

Date object, milliseconds or string

format: string

Default: 'd.m.Y H:i'

php standart time/date formatting. PHP date format manual

utc: bool

Default: false

Show in UTC timezone

placeholder: string

Default: —

Shows when date is incorrect or empty

className: string

Just a wrapper class

Can be used with values

| Value | Format | Time component | with utc flag | | --- | --- | --- | --- | | Empty value | — | | | | Empty value with placeholder | — | no time defined | no time defined | | 1261322332312 | H:i:s | 17:18:52 | 15:18:52 | | new Date(1261322332312) | d.m.Y H:i:s | 20.12.2009 17:18:52 | 20.12.2009 15:18:52 | | new Date() | d.m.Y H:i:s | 08.05.2016 16:22:23 | 08.05.2016 13:22:23 | | 1990-06-16 13:22:17 | d.m.Y H:i:s | 16.06.1990 13:22:17 | 16.06.1990 10:22:17 | | September 2, 2003, 2:26 am | d.m.Y H:i:s | 02.09.2003 02:26:00 | 01.09.2003 23:26:00 | | 2003 36 2003 | d.m.Y H:i:s | | |