1.1.8 • Published 1 year ago

@pluzchat/date-range-picker v1.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

vue-easy-range-date-picker

A simple and easy-to-use range date picker based on Vue2

Installation

npm install --save date-range-picker

Usage

<template>
  <date-range-picker v-model="dates"/>
</template>

<script>
import DateRangePicker from 'date-range-picker';

export default {
  components: {
    DateRangePicker,
  },
  data() {
    return {
      dates: {
        start: 1572879600000,
        end:  1575730800000
      },
    };
  },
}
</script>

Demo

Edit on CodeSandbox

Props

PropsTypeRequiredDefault
v-model(1)Objectyesnull
language(2)Stringno'zh'
colorToday(3)Stringno'#41b883'
colorSelected(3)Stringno'#34495e'
colorActive(3)Stringno'#41b883'

(1) v-model: Binding an object which contains start timestamp and end timestamp:

// example
dates: {
  start: 1573052400000,
  end: 1574434800000
}

you can also pass an empty object as the default value like this:

<template>
  <RangeDatePicker v-model="dates"/>
</template>

<script>
import RangeDatePicker from 'vue-easy-range-date-picker';

export default {
  components: {
    RangeDatePicker,
  },
  data() {
    return {
      dates: {},
    };
  },
}
</script>

Edit on CodeSandbox

(2) Now supporting Chinese('zh'), Japanese('jp'), English('en')

(3)

Event

closePicker event will be emitted when both the start date and end date are selected.

Build Setup

# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
1.1.8

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.16

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.2

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago