Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@havietduc91/vue-date-range-picker

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@havietduc91/vue-date-range-picker

A date range picker Forked from Owumaro repository

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

vue-date-range-picker

A vue component using Bootstrap 4 styles for date range selection

Vue-Treeselect Screenshot

Live demo (jsfiddle)

Features

  • Date range selection
  • Compare feature: select a second date range
  • No integration: DIY with your favorite vue components or js libraries
  • Bootstrap 4 styles (requires Bootstrap 4 CSS)
  • Returns Moment.js instances (requires moment.js)

Installation

npm install --save @havietduc91/vue-date-range-picker

Usage

Webpack

JavaScript
// Import the component
import DateRangePicker from '@havietduc91/vue-date-range-picker'

export default {
  // Register the component
  components: { DateRangePicker },
  
  // Create a method for the submit event
  methods: {
    updateRanges: function(range) {
      ...
    }
  },
  ...
}
HTML template
<date-range-picker v-on:submit="updateRanges" />

API

Events

As the component needs to transmit multiple values (startDate, endDate, compare, startDateCompare, endDateCompare), it can not use v-model.

Instead, it triggers 2 events:

  • submit: when the submit button is clicked; provides an Object argument with the 5 attributes mentioned above
  • cancel: when the cancel button is clicked

Props

PropTypeDefaultDescription
calendar-countNumber2Number of calendars to display
allow-compareBooleantrueEnable/disable the comparison feature
rangesObject{ currentMonth: { ... }, lastMonth: { ... } }Predefined ranges displayed in select menu(s)
default-range-selectStringcurrentMonthKey of the range to select by default
default-range-select-compareStringlastMonthKey of the range to select by default (compare)

Development

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies

npm run build

Inspiration

TODO

  • Tests
  • CSS without bootstrap dependency

FAQs

Package last updated on 27 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc