Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A vue component using Bootstrap 4 styles for date range selection

License

NotificationsYou must be signed in to change notification settings

Owumaro/vue-date-range-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 @owumaro/vue-date-range-picker

Usage

Webpack

JavaScript

// Import the componentimportDateRangePickerfrom'@owumaro/vue-date-range-picker'exportdefault{// Register the componentcomponents:{ DateRangePicker},// Create a method for the submit eventmethods:{updateRanges:function(range){      ...}},  ...}

HTML template

<date-range-pickerv-on:submit="updateRanges"/>

API

Events

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

Instead, it triggers 2 events:

  • submit: when the submit button is clicked; provides anObject 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

About

A vue component using Bootstrap 4 styles for date range selection

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp