0.4.0 • Published 5 years ago

compare-date-picker v0.4.0

Weekly downloads
18
License
MIT
Repository
github
Last release
5 years ago

DatePicker Vue - based date picker plug-in

1.Install: npm install compare-date-picker --save

2.Import global main.js

import compareDatePicker from 'compare-date-picker'
import 'compare-date-picker/dist/compareDatePicker.css'
Vue.use(compareDatePicker)

part

import compareDatePicker from 'compare-date-picker'
import 'compare-date-picker/dist/compareDatePicker.css'
components:{
    compareDatePicker
}

3.Use

1.Shortcuts

The default includes today, yesterday, the past 7 days, the past 14 days, the past 28 days, and the past 30 days, and you can customize the shortcut.

propstypeeventdescribe
OriginQuickyArraycusSetQuickDateCustom shortcut, the default shortcut will be overwritten
example:
 [
    {
        label:'the past 7 days',
        callback(picker) {
            picker.$emit('cusSetQuickDate',[new Date(new Date().setHours(0,0,0,0)).getTime()-8*24*60*60*1000,new Date(new Date().setHours(0,0,0,0)).getTime()-24*60*60*1000])
        }
    }
 ]

1.New features:Optional range can be set

propstypedefaultdescribe
disabledDateArray,new Date().getTime()A date greater than today is not optional

The parameter is an array with a length of 2, representing the minimum and maximum values. The minimum and minimum values and those greater than the maximum values are not optional. If the minimum value is not required, the first value is null; if the maximum value is not required, the second value is null

1.Customize date range

Select the date range according to the location of the click date

2.Whether to display a comparison date

propstypedefaultdescribe
cusCompareShowbooleantrueWhether to display a comparable function

You need to select for comparison, and then you can select the shortcut date range comparison

3.props

propstypedefaultdescribe
originDateArraynew Date(new Date().setHours(0,0,0,0)).getTime() - 72460601000,new Date(new Date().setHours(0,0,0,0)).getTime()It means start time and end time of the comparison ,can be set
compareDateArray[]It means start time and end time of the comparison ,cannot be set
dividerStirng/The dividing line between a start date and an end date
weekNameArray"日","一","二","三","四","五","六"The first must be Sunday and can be changed to other week display

4.event

eventtypedescribe
changefunctionSelect the function to execute after the date is completed
0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago