0.1.12 • Published 5 years ago

vue-slot-calendar v0.1.12

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

vue-slot-calendar

[ demo here ]

Installation

First install the package

npm install --save vue-slot-calendar

Then import it and use it

import VueSlotCalendar from 'vue-slot-calendar'

<template>
	<vue-slot-calendar :minHour=8 :maxHour=22 :gap=2 v-model="selectedSlots" />
</template>
<script>
export  default {
  name: 'app',
  components: {
    VueSlotCalendar
  },
  data: () => ({
    selectedSlots: []
  })
}
</script>

Usage

Props:

proptypedefaultdescription
v-modelArray Object[]all selected slots with informations
hoursArray Numberundefinedhours range/ticks, ex: 8, 10, 12, 14
minHourNumberundefinedfirst hour of the range
maxHourNumberundefinedlast hour of the range
gapNumberundefinedgap of the range
svgPathsObject {String}{}'sun', 'city', 'sky1', 'sky2' keys for custom svg at background
timeSeedNumberundefined (now)unix() milliseconds to set beggining date of the calendar
noDisabledBooleanfalseprevent locking past hours
disableHoursNumber2the next hours that are locked
formatCellFunction(slot, windowWidth) => slot.startDatestring displayed in cells
formatDaysFunction(strDayOfWeek, windowWidth) => ...string displayed for day names
formatHoursFunction(hour, windowWidth) => ${hour}:00-string displayed for hours

You have to set either hours or minHour/maxHour/gap, required.