Skip to content

1987showsun/Datetime-component-by-React-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Datetime Component

時間日期 React元件

API

Name Type Description
name string input name
tiemSwitch boolean select time switch
max String ex:"2018-12-30"
min String ex:"2018-01-01"

Callback

Name Type Description
callBackReturn Object this.functionName.bind(this)

Include

  import Datetime from './calendar';

Start

  npm run online;
  http://localhost:8003 or http://0.0.0.0:8003
  constructor(props){
     super(props);
     this.state = {
        form : {
           startDate : ""
        }
     }
  }
  
  .
  .
  .
  
  test( val ){
    let form = this.state.form;
    form[val.name] = val['value'];
    this.setState({
      form : form
    })
  }
  
  .
  .
  .
  
  render(){
    return <Datetime tiemSwitch="true" name="startDate" callBackReturn={this.test.bind(this)}/>
  }

timeSwitch API Demo Image

timeSwitch="false" timeSwitch="true"
alt text alt text

max and min API Demo Image

max="2018-06-24" min="2018-06-11"
alt text alt text

About

時間日期 React元件

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published