1.3.1 • Published 4 years ago
flex-date-picker v1.3.1
flex-date-picker
A datepicker for PC(尚未完成功能和单元测试,请勿用于开发)
Doc
https://jumodada.github.io/date-picker/#/
Installing
Using npm:
$ npm install flex-date-picker
Using yarn:
$ yarn add flex-date-picker
Usage
es6
import datePicker from 'flex-date-picker'
import 'flex-date-picker/dist/index.css'
CommonJS
const datePicker = require('flex-date-picker').default
require('flex-date-picker/dist/index.css')
Example
<input type="text" id="input">
datePicker(document.querySelector('#input'),{
type:'date'
// options...
})
Options
Options | Description | Type | Accepted Values | Default |
---|---|---|---|---|
type | type of datepicker | string | date/date-range | date |
format | Output format | string | - | yyyy/mm/dd |
placement | datepicker placement | string | top/bottom/right/left | bottom |
disabled | prohibited dates | function | - | - |
Options Example
- disabled
datePicker(document.querySelector('#input'),{
type:'date',
disabled:(date)=>{
return date && date.valueOf() < Date.now()
}
})
Method
name | Description |
---|---|
unbind | unbind |
getDate | Get the currently selected date |
getYear | Get the currently selected year |
getMonth | Get the currently selected month |
Event
name | Description |
---|---|
change | Event triggered when the date changes |
1.3.1
4 years ago
1.3.0
4 years ago
1.2.9
4 years ago
1.2.8
4 years ago
1.2.7
4 years ago
1.2.6
4 years ago
1.2.5
4 years ago
1.2.4
4 years ago
1.2.3
4 years ago
1.2.2
4 years ago
1.2.1
4 years ago
1.2.0
4 years ago
1.1.9
4 years ago
1.1.8
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago