1.3.0 • Published 2 years ago

@glhrm/vue-scheduler v1.3.0

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

📅 Vue Scheduler

npm version license

A library to assist in scheduling appointments for Vue 3.

Demo

Vue Scheduler

Install

$ npm install @glhrm/vue-scheduler --save

or

$ yarn add @glhrm/vue-scheduler

Usage

<template>
  <VueScheduler
    :events="events"
    :ranges="ranges"
  />
</template>

<script>
  import VueScheduler from '@glhrm/vue-scheduler';

  export default {
    components: {
      VueScheduler,
    },
  
    data() {
      return {
        events: [
          {
            all: true,
            interval: { from: '05:00', to: '06:00' },
          },
          {
            date: new Date,
            interval: { from: '06:00', to: '08:45' },
          },
          {
            wday: ['monday', 'wednesday', 'thursday', 'friday'],
            interval: { from: '09:00', to: '11:00' },
          },
          {
            wday: 'thursday',
            interval: { from: '11:00', to: '12:00' },
          },
        ],

        ranges: [
          {
            start: new Date,
            end: new Date,
          },
          {
            start: new Date,
            end: new Date,
          },
          {
          /**
           * Passing only the {start} property we will have a range that will 
           * start on the given date and cover all subsequent dates
           **/
            start: new Date,
          },
        ],
      };
    },
  };
</script>

Properties

Scheduler

PropertyDescriptionTypeDefault
eventsEvents that will be shown on the schedulerEvent[][]
rangesA range of dates that will be highlighted in the schedulerRange[][]
rowsNumber of lines that the scheduler will showNumber5
controlsIndicates whether action buttons will be shownBooleantrue

Event

PropertyDescriptionType
wdayUsed to define recurring eventsString or String[]
dateUsed to set events on fixed dates (Takes precedence over wday)Date
allUsed to define that an event will happen every day. This property takes precedence over all othersBoolean
intervalAn object that informs the start and end time of the eventInterval

Range

PropertyDescriptionType
startRange start dateDate
endRange end dateDate

Interval

PropertyDescriptionType
fromEvent start timeString
toEvent end timeString

Events

NameDescriptionCallback Arguments
select-dateWhen only one date is selected with a simple click{ date: Date, events: Event[] }
select-datesWhen multiple dates are selected by clicking and dragging{ dates: Date[] }

License

MIT

Copyright (c) Guilherme Moura

1.3.0

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago