2.8.4 • Published 2 years ago

vue-calendar-selectable v2.8.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

SelectableCal

A datepicker Vue component. Compatible with Vue 2.x

Demo

To view demo examples locally clone the repo and run npm i && npm serve --open App.vue

gif

Install

npm i vue-draggable-cal --save

or

yarn add vue-draggable-cal
import SelectableCal from 'vue-calendar-selectable';

export default {
  // ...
  components: {
    SelectableCal,
  },
  // ...
};

Usage

<selectable-cal></selectable-cal>

<!-- OR -->

<SelectableCal></SelectableCal>

Emits events

<SelectableCal @dateSelected="doSomething($event)"></SelectableCal>

Available props

PropTypeDefaultDescription
daysNumber365Number of days to append
monthsNumber12Numbers of months to append (has precedence over days if custom set)
yearsNumber0Number of years to append and enable year mode (see Demo )
prependedYearsNumber0Number of years to preppend. Note: this prop is ignored if years is not set
prependedMonthsNumber1Number of month to preppend
disabledWeekDaysObject{}Disable a specific week day by setting it's day number to true. ie. {0: true} will disable sundays
disabledDatesArray[]Disable a specific date. Format of the day should be a string YYYY-MM-DD ie. ['2018-01-01']
pastIsDisabledBooleantrueAllows the selection of alreay past days and predend the days of prepended months
fullMonthsBooleanfalseWeither or not to always use complete months (i.e. days=1 if set to true the whole month is going to be appended)
accentColorString#00008bSet the accent color (HEX or CSS color names)
langStringENLanguage (see available in Transations

Events

These events are emitted on actions in the datepicker

EventOutputDescription
selectedDateObjectA date has been selected. It outputs an object : formatedDate: String of the date andraw: An array of YYYY, MM, DD that can be used to build the date object via Date.UTC(YYYY,MM,DD)
dateClearednullThe previously selected date has been unselected by the user

Available languages

AbbrLanguage
ENEnglish
FRFrench
PT_BRPortuguese (BR)Default

Dev & Build

Dev server

  yarn serve # Or npm run serve

Build App

  yarn build # Or npm run build

Build Lib

  yarn bundle # Or npm run bundle

License

MIT

Thanks

Credits to @webAngelo for his range-calendar from which this is highly inspired.