npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-material-datepicker

v2.0.1

Published

vue datepicker with a material-ui design

Downloads

28

Readme

#vue-material-datepicker This datepicker is a fully customisable Vue(v2.1.6) version of the material-ui datepicker that fit all your projects.

See below to discover all customisable components.

#Contact Please give me some feedbacks to improve it !

If you have some issues or if you want to contribute, feel free to email me to !

email : [email protected]

#Demo ##Simple portrait simple datepicker

Change Years

##Doubled portrait doubled datepicker

change year doubled

##Simple landscape simple landscape simple years landscape

##Doubled landscape doubled landscape doubled years landscape

#Installation

npm

$ npm install vue-datepicker

#Requirements moment^2.14.1

#Usage

import Vue from 'vue';
import Datepicker from 'vue-material-datepicker';

new Vue({
    el: 'body',
    components: { datepicker: Datepicker }
});
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>datepicker</title>
    
    <link href="https://fonts.googleapis.com/css?family=Roboto:100" rel="stylesheet">

    <style>
    	body {
    		font-family: 'Roboto', sans-serif;
    	}
    </style>
  </head>
  <body>

    <datepicker></datepicker>

  </body>
</html>

#API ##format Date's format written in the text input

date input

type : String
required : false
default : "YYYY-MM-DD"

e.g :

<datepicker format="DD/MM/YYYY"></datepicker>

result:
date format result

##lang The project's language

type : String
required : false
default : "en"

supported languages:
"da" Danish
"nl" Dutch
"de" German
"es" Spanish
"fi" Finnish
"fr" French
"fr-ca" French(Canada)
"fr-ch" French(Switzerland)
"hu" Hugarian
"it" Italian
"lb" Luxembourgish
"nb" Norvegian
"pl" Polish
"pt" Portuguese
"pt-br" Portuguese(Brazil)
"ro" Romanian
"ru" Russian
"sk" Slovak
"sl" Slovenian
"sv" Swedish
"uk" Ukrenian

Traductions were made base on Google Translate... Feel free to email me if there are some mistakes or if your language is not supported yet.

e.g :

<datepicker lang="fr"></datepicker>

result :
lang result

##disablePassedDays Boolean to disable passed days

type : Boolean
required : false
default : false

e.g :

<datepicker :disable-passed-days="true"></datepicker>

result :
disabledPassedDays

##disabledDays Array of moment or date to disable.
Date format must be YYYY-MM-DDor YYYY-MM-D

type : Array
required : false
default : []

e.g :

<datepicker :disabled-days="arrayOfDisabledDays"></datepicker>
new Vue({   
    el: 'body',   
    components: { datepicker: Datepicker },   
    data() {   
        return {   
            arrayOfDisabledDays: []   
        }   
    },   
    ready() {   
        for (let i=0; i<31; i++) {   
            var tmp = moment().add(i, 'days');   
            if (i%2) this.arrayOfDisabledDays.push(tmp);   
        }   
    }   
});   

result:
disabledDays

##name Field's name attribute

type : String
required : false
default : "datepicker"

e.g :

<datepicker name="event_date"></datepicker

##id Field's id attribute

type: String
required: false
default: "vue-datepicker"

e.g :

<datepicker id="my-datepicker"></datepicker>

##class-design To bind style to datepicker's input you can pass a css class as in the exemple below.

type: String
required: false
default: ""

e.g:

.input-style {
    display: block;
    padding: 5px;
    font-size: 16px;
    line-height: 16px;
    background-color: #ffffff;
    border: 1px solid #B7B7B7;
    border-radius: 4px;
}
<datepicker class-design="input-style"></datepicker>

result :
input style

##Orientation As shown before, this datepicker can be Protrait or Landscape

type: String
required: false
default: "portrait"

supported orientation: "portrait"
"landscape"

e.g:

<datepicker orientation="landscape"></datepicker>

result:
datepicker landscape exemple

##Color customisation. Color customisation si not supported yet. But you can overwrite css classes as below :

$primary-color: #3F51B5;
$secondary-color: #FFFFFF;

.datepicker-header {
    background-color: $primary-color !important;
}

.datepicker-day-effect {
    background-color: lighten($primary-color, 5%) !important;
}

.datepicker-day {
    &:hover {
        color: $secondary-color !important;
    }

    &.selected {
        color: $secondary-color !important;
    }
}

.datepicker-date, .datepicker-year  {
    color: $secondary-color !important;
}

.datepicker-actions {
    button {
        color: lighten($primary-color, 10%) !important;
        &:hover {
            background-color: darken($secondary-color, 5%) !important;
        }
    }
}

.datepicker-years {
    .datepicker-years-content {
        .datepicker-year {
            &.selected, &:hover {
                color: $primary-color !important;
            }
        }
    }
}

result :
color customisation

#Next steps

  • responsive
  • color customisation
  • date range