Skip to content

aminNazarii/vue-j-calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-j-calendar

vuejs date time picker

Installation

You can install it via yarn or NPM.

$ npm install vue-j-calendar --save

$ yarn add vue-j-calendar

Configuration

import Vue from "vue";
window.Vue = Vue;

//options is optional

let options = {
    locale: 'fa',
    languages: {
        fa: {
            nextMonth: 'ماه بعد',
            prevMonth: ' ماه قبل',
            today: 'الان'
        },
    }
};

import VueJCalendar from 'vue-j-calendar';
Vue.use(VueJCalendar, {options});

Usage

<template>
    <div>
        <div>{{selectedDay.format('jYYYY-jMM-jDD')}}</div>
        <calendar :default="currentDate" @change="selectDay"></calendar>
    </div>
</template>


<script>
    export default {
        name: 'layout',
        data() {
            return {
                //also => currentDate: moment()
                currentDate: '1399-09-14', //[optional] if you set this current day set default
                selectedDay: null,
            }
        },
        methods: {
            selectDay(day) {
                this.selectedDay = day;
            },
        }
    }
</script>

About

vuejs date time picker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published