1.0.3-beta.11 • Published 6 years ago

vue-fast-datetime v1.0.3-beta.11

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

vue-fast-datetime

A quick select datetime picker component for vue.js

DEMO HERE

Go to demo.

Screen record

Install

npm i vue-fast-datetime -D

Usage

As global component

  import FastDatetime from 'vue-fast-datetime'
  import 'vue-fast-datetime/dist/vue-fast-datetime.min.css'
  Vue.use(FastDatetime)

This will register a global component <fast-datetime>

  <fast-datetime
    position="start"
    :startDate=startDate
    :endDate=endDate
    :startValue=dateValueStart
    :endValue=dateValueEnd>
  </fast-datetime>

As plugin

  import FastDatetime from 'vue-fast-datetime'
  import 'vue-fast-datetime/dist/vue-fast-datetime.min.css'
  Vue.use(FastDatetime)

This will register a plugin this.$FastDateTime.show

 this.$FastDateTime.show({
  position:'start',
  startDate: this.startDate,
  endDate: this.endDate,
  startValue: this.dateValueStart,
  endValue:this.dateValueEnd
})

Available props

The component accepts these props:

AttributeTypeDefaultDescription
positionStringstartInitial the first choose time whether starttime or endtime
startDateObject Date-The starttime of fase-datetime (required)
endDateObject Date-The endtime of fase-datetime (required)
startValueString-Current value of starttime,this value must be less than the starttime (required)
endValueString-Current value of endtime,this value must be less than the starttime (required)
confirmTextStringokThe text of confirm button
cancelTextStringcancelThe text of cancel button
hourRowString{value}Template of hourRow
minuteRowString{value}Template of minuteRow

methods

nametypeDefaultDescription
onSelect / @on-changeFunction(type, value, wholeValue) => {}CallBack after date scroller value changed, pass three arguments, current scroller type type and current scroller value value and datetime value wholeValue
onConfirmFunction(startValue, endValue)CallBack after click confirm button,set current startValue and endValue
onShow / @on-showFunction:---:show the vue-fast-datetime
onHide / @on-hideFunction:---:hide the vue-fast-datetime

CHANGELOG

1.0.3-beta.10

  • fix some bugs

1.0.0

  • Initial release

License

MIT

1.0.3-beta.11

6 years ago

1.0.3-beta.10

6 years ago

1.0.3-beta.9

6 years ago

1.0.3-beta.8

6 years ago

1.0.3-beta.7

6 years ago

1.0.3-beta.6

6 years ago

1.0.3-beta.5

6 years ago

1.0.3-beta.4

6 years ago

1.0.3-beta.3

6 years ago

1.0.3-beta.2

6 years ago

1.0.3-beta.1

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago