1.3.1 • Published 4 years ago

flex-date-picker v1.3.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

flex-date-picker

A datepicker for PC(尚未完成功能和单元测试,请勿用于开发)

npm.io npm.io build status

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

OptionsDescriptionTypeAccepted ValuesDefault
typetype of datepickerstringdate/date-rangedate
formatOutput formatstring-yyyy/mm/dd
placementdatepicker placementstringtop/bottom/right/leftbottom
disabledprohibited datesfunction--

Options Example

  • disabled
datePicker(document.querySelector('#input'),{
      type:'date',
      disabled:(date)=>{
        return date && date.valueOf() < Date.now() 
      }
    })

Method

nameDescription
unbindunbind
getDateGet the currently selected date
getYearGet the currently selected year
getMonthGet the currently selected month

Event

nameDescription
changeEvent 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