Localized, accessible calendar and datepicker for Vue with no external dependencies

Overview

Vue A11Y Calendar

Localized, accessible calendar and datepicker for Vue with no external dependencies.

Installation

$ npm install vue-a11y-calendar

Peer Dependencies

Vue A11Y Calendar depends on Vue 2.4+ and if using webpack, Sass Loader 6.0+. Make sure they (and their peer dependencies) are installed and correctly configured in order to effectively use Vue A11Y Calendar. While this has been tested with webpack, it should work with any module bundler.

Recommended Webpack Configuration Additions

In addition to the required configuration for Sass Loader, the following configuration is recommended to be included:

const path = require('path');

function resolve (dir) {
  return path.join(__dirname, dir) // Change this to resolve to the root of your project
}

const config = {
  resolve: {
    extensions: ['.js', '.vue', '.json'],
    mainFiles: ['index', 'index.vue'],
    alias: {
      'vue$': 'vue/dist/vue.esm.js',
      '@': resolve('src'), // Replace `src` with the path to your source files from the root of your project
      '~': resolve('node_modules'),
    },
  },
};

The above configuration will allow .js, .vue, and .json files to be imported/required without including their extensions, allow index.js and index.vue files to be found as files to be imported when importing/requiring a folder (so calendar/index.vue can just be included/requires as calendar), and will resolve Vue to the correct version, and allow shortcut imports @ for source files and ~ for Node modules (useful for things distributed through Node modules that can't be directly imported). This will allow for code like import foo from '@/foo'; and import calendar from 'vue-a11y-calendar/calendar';.

Components

Calendar

The Calendar component provides a responsive, dynamic, accessible, localized (using Date.prototype.toLocaleString()) month-based calendar.

Props

  • {string} locale - Any valid single locale for Date.prototype.toLocaleString()
  • {object} microcopy - Translatable strings for the microcopy for the calendar. All properties must be present to be valid.
    • {string} microcopy.today - String representation of Today: {date}. Must include {date}, which will be replaced with the localized date.
    • {string} microcopy.next - String representation of Next Month.
    • {string} microcopy.previous - String representation of Previous Month.

Events

  • dateSelected(target) - When a click event is fired on a date, this event will fire and pass the relevant target of the event.

Datepicker

The Datepicker component provides a dynamic, accessible, localized (using Date.prototype.toLocaleString()) month-based datepicker.

Props

  • {string} locale - Any valid single locale for Date.prototype.toLocaleString()
  • {string} label - A string for the label of the input field. Defaults to Choose a date.
  • {object} microcopy - Translatable strings for the microcopy for the calendar. All properties must be present to be valid.
    • {string} microcopy.today - String representation of Today: {date}. Must include {date}, which will be replaced with the localized date.
    • {string} microcopy.next - String representation of Next Month.
    • {string} microcopy.previous - String representation of Previous Month.
    • {string} microcopy.open - String representation of Open Calendar.
    • {string} microcopy.cancel - String representation of Cancel.
  • {object} inputs - Input names (so multiple datepickers can be used in the same form).
    • {string} inputs.local - Input name and ID for the visible, read-only input field. Defaults to date-local.
    • {string} inputs.month - Input name for the hidden numeric day input. Defaults to date-day.
    • {string} inputs.month - Input name for the hidden numeric month input. Defaults to date-month.
    • {string} inputs.year - Input name for the hidden numeric year input. Defaults to date-year.

Customization

Neither the Calendar component nor the Datepicker component use scoped styles or CSS modules. While this isn't ideal from a performance perspective, it is the only reasonable way to allow users to write custom CSS to style these components from within their own components. A downside to this is that implementing components can't have their styles scoped or use CSS modules either, or styling won't cascade properly. To change styling of one of these components, it is recommended to wrap it in a single component and mirror the props down.

Classes are styled using BEM to, as best as possible, target the exact elements to be styled.

Alternatively, the HTML, JS, and Sass for each component has been split out in to separate files that can be imported individually. The HTML and JS can used to rebuild the components piecemeal with custom styling (even allowing for scoped styling if desired).

Roadmap

We use ZenHub to manage our backlog and roadmap (items higher in our backlog pipeline are higher in our roadmap). You can view the board directly in the ZenHub webapp, or install the Chrome or Firefox extension and view it directly on GitHub.

External Licenses

The Calendar icon is licensed under the Creative Commons Attribution 4.0 International License by International Business Machines Corporation. It is from IBM Design Icons.

You might also like...
A simple and sweet vue.js calendar
A simple and sweet vue.js calendar

vue-sweet-calendar A simple and sweet vue.js calendar Features Showing Multiple-Events Fully customizable How to install npm install vue-sweet-calenda

A simple vue calendar component. Base for further development and styling.

vue-simple-calendar A simple vue calendar component with minimal css. A base for further development/styling. DEMO Dependencies date-fns, lodash-es In

Full calendar base on Vue2 and momentjs.

Vue2 Calendar Component Full calendar base on Vue2 and dayjs. Support month and week view. Custom date item style with scopeSlots. 中文文档 📺 Live demo I

A responsive and customizable Github heatmap calendar.

vue-github-calendar A responsive and customizable Github heatmap calendar for Vue.js Usage Install npm install vue-github-calendar Import the componen

vue calendar fullCalendar. no jquery required. Schedule events management
vue calendar fullCalendar. no jquery required. Schedule events management

##vue-fullcalendar Works for Vue2 now. This is a fullCalendar component based on vue.js . No Jquery or fullCalendar.js required. Currently, It only su

A vue component for lunar calendar.

vue-lunar-calendar A vue component for lunar calendar. Uses Moment.js for date operations. This is the Korean lunar calendar. It is different from Chi

Simple Vue component to show a month-grid calendar with events

VueSimpleCalendar Introduction vue-simple-calendar is a flexible, themeable, lightweight calendar component for Vue that supports multi-day scheduled

A simple infinite calendar component in Vue 2
A simple infinite calendar component in Vue 2

vue-infinite-calendar A simple infinite calendar component in Vue 2 Build Setup # install dependencies npm install # serve with hot reload at localho

A calendar component for Vue.js

calendar Chinese This is a calendar component based on vue.js . support custom content. No dependencies. Currently, It only supports month view. You c

Owner
Rohan C
Rohan C
A simple events calendar for Vue2, no dependencies except Vue2.

vue-event-calendar A simple events calendar for Vue2, no dependencies except Vue2. responsive & mobile first. Live Demo Here 中文文档 Requirements vue: ^2

Geoff Zhu 633 Nov 11, 2022
An elegant calendar and datepicker plugin for Vue.

An elegant calendar and datepicker plugin for Vuejs. npm i --save v-calendar Documentation For full documentation, visit vcalendar.io. Attributes High

Nathan Reyes 3.7k Dec 31, 2022
Contra - Combines GitHub and GitLab contributions calendar to create a single calendar

Welcome to Contra ?? Combines GitHub and GitLab contributions calendar to create

Ahmet Korkmaz 10 Dec 29, 2022
Simple-calendar-app - Simple Vue calendar (date-picker)

Simple vue calendar (date-picker) Vue Moment.js Installation git clone npm i npm

Dmitry Chinenov 3 Oct 31, 2022
easy datepicker of a vue 2.0 component

vue-datepicker-infinite easy datepicker of a vue 2.0 component install npm install vue2-datepicker-infinite --save how to use template: <transition

Chen Leepyng 16 Nov 24, 2022
Datepicker Component For Vue

Vue Datepicker Component A Datepicker Component For VueJs (https://edisdev.github.io/vue-datepicker-ui) Props <Calendar v-model="" :range

Hatice Edis 404 Dec 20, 2022
A datepicker / datetimepicker component for Vue2

vue2-datepicker 中文版 A Datepicker Component For Vue2 Demo https://mengxiong10.github.io/vue2-datepicker/index.html Install $ npm install vue2-datepicke

也无风雨 1.4k Dec 26, 2022
VueJS wrapper component for Pikaday datepicker

Vue Pikaday VueJS wrapper component for Pikaday datepicker Install npm i -D @netcz/vue-pikaday or yarn add -D @netcz/vue-pikaday Usage Please consult

Michal Szajter 37 Sep 10, 2021
Simple and clean calendar written in Vue.js

Vuelendar Simple and clean calendar written in Vue.js. Check out full Vuelendar's documentation here. Features Select single date Select range of date

The Codest 76 Oct 5, 2022
📅 A feature-rich calendar component, support multiple modes and gesture sliding. For vue 3.0+

?? A calendar component for vue3.0. Support gesture sliding, range selection, according to the week switch...

飞翔的荷兰人 434 Jan 3, 2023