All Projects → FranckFreiburger → vue-calendar-picker

FranckFreiburger / vue-calendar-picker

Licence: MIT license
Calendar component

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vue-calendar-picker

Calendar.js
📅 A drag & drop event calendar (for Javascript), that is fully responsive and compatible with all modern browsers.
Stars: ✭ 29 (-38.3%)
Mutual labels:  datepicker, calendar-events
react-semantic-ui-datepickers
Datepickers built with Semantic UI for React and Dayzed.
Stars: ✭ 87 (+85.11%)
Mutual labels:  datepicker
Vue Bootstrap Datetimepicker
Vue.js component for eonasdan bootstrap datetimepicker
Stars: ✭ 221 (+370.21%)
Mutual labels:  datepicker
Vue Datepicker Ui
Datepicker Component For Vue
Stars: ✭ 252 (+436.17%)
Mutual labels:  datepicker
Calendarview
A highly customizable calendar library for Android, powered by RecyclerView.
Stars: ✭ 2,862 (+5989.36%)
Mutual labels:  datepicker
datepickertimeline
Linear date picker for Jetpack compose
Stars: ✭ 43 (-8.51%)
Mutual labels:  datepicker
Persian Date Picker Dialog
Persian Date Picker Dialog for Android
Stars: ✭ 205 (+336.17%)
Mutual labels:  datepicker
HorizontalTimesLayout
Layout to display time slots in horizontal 24 hour format
Stars: ✭ 31 (-34.04%)
Mutual labels:  calendar-events
react-modern-datepicker
A modern date picker for react library
Stars: ✭ 19 (-59.57%)
Mutual labels:  datepicker
React Datepicker
An easily internationalizable, accessible, mobile-friendly datepicker library for the web, build with styled-components.
Stars: ✭ 252 (+436.17%)
Mutual labels:  datepicker
Adm Datetimepicker
Pure AngularJs dateTimePicker
Stars: ✭ 244 (+419.15%)
Mutual labels:  datepicker
Flatpickr
lightweight, powerful javascript datetimepicker with no dependencies
Stars: ✭ 14,575 (+30910.64%)
Mutual labels:  datepicker
nepali-date-picker
Nepali Date Picker jQuery Plugin 🇳🇵
Stars: ✭ 71 (+51.06%)
Mutual labels:  datepicker
Vuejs Datepicker
A simple Vue.js datepicker component. Supports disabling of dates, inline mode, translations
Stars: ✭ 2,529 (+5280.85%)
Mutual labels:  datepicker
react-calendar-datetime-picker
A simple and fast date and time picker component for React
Stars: ✭ 58 (+23.4%)
Mutual labels:  datepicker
Datepicker
Get a date with JavaScript! A datepicker with no dependencies.
Stars: ✭ 212 (+351.06%)
Mutual labels:  datepicker
Didatepicker
Yet another datepicker for iOS
Stars: ✭ 242 (+414.89%)
Mutual labels:  datepicker
nativescript-datetimepicker
Plugin with date and time picking fields
Stars: ✭ 26 (-44.68%)
Mutual labels:  datepicker
praecox-datepicker
A date picker built with Svelte.Simple and flexible, supporting functions such as single selection, multiple selection, disabling, and marking.
Stars: ✭ 66 (+40.43%)
Mutual labels:  datepicker
react-monthrange-picker
ReactJS month calendar component
Stars: ✭ 14 (-70.21%)
Mutual labels:  datepicker

vue-calendar-picker

Calendar component

vue-calendar-picker screenshot

vue-calendar-picker demo on jsfiddle

Example - basic

<template>
    <calendar></calendar>
</template>

<script>

import {calendar} from 'vue-calendar-picker'

export default {
    components: {
        calendar: calendar
    }
}

</script>

Install

npm install --save vue-calendar-picker

Features

  • zoom from decade view to hour view (decade, year, month, week, day, hour)
  • localized (see supported locale list)
  • autodetect the first day of the week
  • animated (zoom & slide)
  • multiple calendar views (side-by-side)
  • display one-time events and date/time period
  • date/time period selection
  • touch screen support
  • only one dependancy: date-fns, a Modern JavaScript date utility library

vue-calendar-picker has 3 available components:

  • calendar.vue: simple calendar.
  • calendarEvents.vue: calendar.vue + one-time events and date/time periods display.
  • calendarRange.vue: calendarEvents.vue + range selection.

Conventions

  • date ranges are inclusive, exclusive ([start, end[)

API - calendar.vue

Properties

:locale string, default: navigator.language

The locale of the calendar. Impacts the days names, month names and first day ofthe week. supported locale list. Locale name must be uppercase.

:compact boolean, default: false

Enable compact mode. Use less UI space.

:initialView number, default: 6 (month view)

Initial view zoom.

:initialCurrent Date, default: new Date

Initial view date.

:itemClass function(range), default: empty function

Called for each calendar cell. The retun valus is used as className of the cell.

:viewCount number, default: 1

Allow to display multiple calendar views side-by-side.

:showOverlappingDays boolean, default: viewCount === 1

In the month view, show days belonging to the preceding and following month.

Events

@action (eventObject)

eventObject has the following properties:

eventType string
  • 'down': mousedown or touchstart
  • 'up': mouseup or touchend
  • 'tap': click or tap
  • 'press': dblclick or longtap
  • 'over': mouseover or touchmove
eventActive boolean

Indicates that the pointer is active: a mouse button is down or the finger touches the screen.

keyActive boolean

Indicates that the shift or ctrl or alt or meta key is down. Always false on touch-screen devices.

range { start: Date, end: Date }

The date range of the item

rangeType string

The range name: 'minute', 'hour', 'day', 'week', 'month', 'year'.

Slots

default slot scope: itemRange, layout / default: empty

The content of calendar cells.

itemRange { start: Date, end: Date }

The time range of the the cell.

layout string

The layout of the content, either 'horizontal' or 'vertical'.

Styling

vue-calendar-picker can by styled easily, all css selectors are prefixed with .calendar.

example
.calendar {
    border: 2px solid #000;
    border-radius: 0.5em;
    padding: 0.5em;
}

UI details

  • click on date part in the calendar header area to modify it (zoom out)
  • click or double-click on the cell to zoom in. (from month view, use double-click to zoom in)

API - calendarEvents.vue

Properties

:locale - see calendar.vue API.

:compact - see calendar.vue API.

:initialView - see calendar.vue API.

:initialCurrent - see calendar.vue API.

:itemClass - see calendar.vue API.

:events Array for { color: CSS color, start: Date, end: Date }

A list of one-time events and date/time periods to display in the calendar.
One-time events has the same start and end date.

:selection { start: Date, end: Date }

The current calendar selection. For display only.

Events

@action (eventObject)

eventObject has the same properties that calendar.vue added:

calendarEvent object

A reference to a calendar event (see :events property) related to the mouse/touch event, otherwise undefined.

UI details

  • event range are colored lines
  • event point are big dots

API - calendarRange.vue

Allow user selection. The selection property object is modified according to the user's selection.

Properties

:locale - see calendar.vue API.

:compact - see calendar.vue API.

:initialView - see calendar.vue API.

:initialCurrent - see calendar.vue API.

:itemClass - see calendar.vue API.

:events - see calendarEvents.vue API.

:selection - see calendarEvents.vue API.

:useTwoCalendars boolean, default: false

Display two calendars side-by-side to make selection easier.

Events

@action (eventObject)

eventObject has the same properties that calendar.vue.

UI details

  • use mousedown + move or tap + move to select a range (also across calendars)
  • use ctrl + click to update the selection from the nearest end point (disbled on touch screens)

Browser support

Same browser support as Vue.js 2

Example - advanced

<template>
    <calendar-range :events="calendarEvents" :selection="calendarSelection"></calendar-range>
</template>

<script>

import {calendarRange} from 'vue-calendar-picker'

export default {
    components: {
        calendarRange: calendarRange
    },
    data() {
        return {
            calendarEvents: [
                // periods
                { color:'#aaf', start: new Date(2016, 9, 5, 0,0,0,0), end: new Date(2017, 4, 15, 0,0,0,0) },
                { color:'#afa', start: new Date(2016, 9, 5, 0,0,0,0), end: new Date(2017, 4, 13, 0,0,0,0) },
                { color:'#faa', start: new Date(2017, 4, 8, 12,30, 0,0), end: new Date(2017, 4, 9, 6,30, 0,0) },
                // one-time
                { color:'#faa', start: new Date(2017, 4, 2, 0,0,0,0), end: new Date(2017, 4, 2, 0,0,0,0) },
                { color:'#aaa', start: new Date(2017, 4, 2, 0,0,0,0), end: new Date(2017, 4, 2, 0,0,0,0) },
            ],
            calendarSelection: {
                start: new Date(2017, 4, 2), end: new Date(2017, 4, 7, 12)
            }
        }
    }
}
</script>

Demo

vue-calendar-picker demo

Credits

Franck Freiburger

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].