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-nice-datetime

v1.0.7

Published

react,datetime,datetimepicker

Downloads

7

Readme

react-datetime-picker

A independent and powerful date time picker for React

Features

  • date time, date, time picker
  • no dependencies
  • auto detect format. support year, month, date, time mode
  • time period

install

npm install react-nice-datetime —save

Usage

normal usage

import DateTimePicker from 'react-nice-datetime';

<DateTimePicker
  value='1970-01-01'
  limit={min: moment().format('YYYY-MM-DD'), max: moment().format('YYYY-MM-DD')}
/>

DateTimePicker Props

value: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), 支持符合 moment 日期格式的字符串以及 moment 对象。

format: PropTypes.string 符合 moment 的时间格式化字符串,可以是 'YYYY年M月DD日'等比较特殊的格式 支持一下几种选择器 YYYY,YYYY-MM, YYYY-MM-DD, YYYY-MM-DD HH,YYYY-MM-DD HH:mm,YYYY-MM-DD HH:mm:ss

position: PropTypes.string, 选择器和输入框对齐的位置 值为['top-right', 'top-left','bottom-right', 'bottom-left']

disabled: PropTypes.bool,

onChange: PropTypes.func.isRequired,

startOf: PropTypes.bool

endOf: PropTypes.bool, 如果为 true 会调用 moment().endOf() 来获取当前时间格式的低一级单位的最大值 如格式 YYYY-MM-DD 的日期,得到的 moment 对象实际值为 YYYY-MM-DD 23:59:59 注意:用来在触发日期变更前进行修改日期,startOf 和 endOf 只能二选其一,两个都提供,则只使用 endOf

limit: PropTypes.object, 形如 {min, max} 的对象

className: PropTypes.string,

style: PropTypes.object,

clearable: PropTypes.bool,true 表示可以清空日期,默认 true

inputIconClass: PropTypes.string 输入框右侧图标样式,例如 'fa fa-calendar'

Period Props

key: PropTypes.string, the key prop for react element.

value: PropTypes.object, {start, end}

className: PropTypes.string,

style: PropTypes.object,

format: PropTypes.string, the format prop of DateTimePicker format prop.

connector: PropTypes.any, the connector between two DateTimePicker.

onChange: PropTypes.func,

startEndOf: PropTypes.bool, the start date will use startOf, and end date will use endOf

limit: PropTypes.object, {start, end} the range of period

clearable: PropTypes.bool,

disabled: PropTypes.bool,

inputIconClass: PropTypes.string, the icon class of input icon

utils

parseFormat(String): parse format string to object with {dateType, timeType, unit, value}. eg. format is 'YYYY-MM-DD HH:mm:ss' will parsed as {dateType: 'D', timeType: 's', unit: 'second', value: 'YMDHms'}

ChangeLog

2017-03-06 v1.0.7

  • Fix Mac file name case insensitive bug

2017-03-06 v1.0.6

* Period support disabled prop

2017-01-10 v1.0.5

* fix Period bug

2017-01-10 v1.0.4

* fix weekends highlight bug
* fix limit not active bug

2016-11-17 v1.0.3

* use a new path for webpack
* add default period styles

2016-11-16 v1.0.1 * add Period component

2016-11-07 v1.0.0 * first version