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

react-mobile-datepicker

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-mobile-datepicker

一个移动端时间选择器react组件

  • 1.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.8K
decreased by-25.85%
Maintainers
1
Weekly downloads
 
Created
Source

react-mobile-datepicker

Travis npm package Coveralls

一个移动端时间选择器react组件

安装

Using npm:

$ npm install react-mobile-datepicker --save

然后,使用模块加载工具流,支持common.js或ES2015模块,例如webpack

// Using an ES6 transpiler like Babel
import InfiniteCalendar from 'react-mobile-datepicker';
import 'react-mobile-datepicker/dist/react-mobile-datepicker.css'; // Make sure to import the default stylesheet

// Not using an ES6 transpiler
var InfiniteCalendar = require('react-mobile-datepicker');
require('react-mobile-datepicker/dist/react-mobile-datepicker.css');

使用

例子

import React, { Component } from 'react';
import { render } from 'react-dom';
import InfiniteCalendar from 'react-mobile-datepicker';
import 'react-mobile-datepicker/dist/react-mobile-datepicker.css'; // only needs to be imported once

// Render the Calendar
var today = new Date();
var minDate = Number(new Date()) - (24*60*60*1000) * 7; // One week before today

class Wrap extends Component {
	state = {
		isOpen: true,
	}
	render() {
		return (
			<DatePicker
				isOpen={this.state.isOpen}
				startDate={today}
				minDate={minDate}
				onCancel={() => { this.state.isOpen = false; }}
				onSelect={(time) => { console.log(time); }} />
		);
	}
}


render(
  <Wrap />,
  document.getElementById('root')
);

Prop Types

PropertyTypeDefaultDescription
btnColorString#fff完成按钮颜色
dateColorString#fff日期文字颜色
layerBackgroundString#ffa70b背景颜色
isOpenBooleantrue是否显示
startDateDatenew Date()初始日期
minDateDate前一周最小日期
maxDateDatenew Date()最小日期
onSelectFunction() => {}点击完成后的回调函数, Date对象作为参数
onCancelFunction() => {}隐藏时间选择器的回调函数

Changelog

v1.0.3 - Thu, 23 Jun 2016 13:22:13 GMT

  • 5a93fe9 [changed] 更新了READEME

FAQs

Package last updated on 24 Jun 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