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-customizable-datepicker

v0.1.5

Published

Vue Customizable Datepicker

Downloads

118

Readme

Vue Customizable Datepicker

Try it out here: Vue Customizable Datepicker

🚀 Usage

npm i vue-customizable-datepicker

npm version npm downloads npm downloads

Nuxt.js usage

Create plugin (datepicker.js)

import Vue from 'vue'
import DatePicker from 'vue-customizable-datepicker'

Vue.component('DatePicker', DatePicker);

// nuxt.config.js
plugins: [
  {src: '@/plugins/datepicker', ssr: false}
],

// remember to add ssr: false

Slots

Day

<template v-slot:day="{day}">
  <span>{{ day }}</span>
</template>

Value

<template v-slot:value="{date}">
  <span>{{ date }}</span>
</template>

// If range prop is set to true
<template v-slot:value="{from, to}">
  <span>{{ from }}</span>
  <span>{{ to }}</span>
</template>

Header

<template v-slot:header="{month, year}">
  <span>{{ month }}</span>
  <span>{{ year }}</span>
</template>

Other slots

  • arrow-month-next
  • arrow-month-previous
  • arrow-year-next
  • arrow-year-previous

Events

| Event | Data | | ------ | ------ | | year-change | {year: Number, month: Number} | | month-change | {year: Number, month: Number} |

Props

| Prop | Default | Description | | ------ | ------ | ------ | | arrows | true | ------ | | closeOnClick | true | ------ | | dayNames | {1: "Mo",2: "Tu",3: "We",4: "Th",5: "Fr",6: "Sa", 0: "Su"} | ------ | | disabledDates | [] | ------ | | disableBefore | Date | ------ | | disableAfter | Date | ------ | | exactRangeDates | false | Return array of days | | fillEmpty | true | ------ | | fillRange | true | ------ | | firstDay | 1 | ------ | | format | true | %d.%m.%Y | | numberOfCalendars | 1 | ------ | | opened | false | Always opened | | placeholder | Pick a date | ------ | | range | false | Range picker | | zeroPad | true | Zero pad all except days | | zeroPadDays | false | Zero pad days |

disabledDates

<DatePicker :disabled-dates="disabledDates" v-model="selectedDate">
selectedDate: new Date(),
disabledDates: [
  // To disable range of dates
  [new Date('7/12/2020'), new Date('7/18/2020')],
  
  // To disable single date
  new Date('9/8/2020'),
  
  // example:
  // Disable range from 7/24/2020 to 7/27/2020 + diasble 7/29/2020
  [new Date('7/24/2020'), new Date('7/27/2020')], new Date('7/29/2020')
]

v-model

If range prop is set to true value will be object with from and to properties.

{
  from: 'Fri Jul 10 2020 00:00:00 GMT+0200 (Central Eu...'
  to: 'Wed Jul 15 2020 00:00:00 GMT+0200 (Central Eu...'
}

If range and exactRangeDates props are set to true value will be array of dates.

[
  'Thu Jul 09 2020 00:00:00 GMT+0200 (Central Eu...',
  'Fri Jul 10 2020 00:00:00 GMT+0200 (Central Eu...',
  'Sat Jul 11 2020 00:00:00 GMT+0200 (Central Eu...'
]

Otherwise value will be Date object.

"2020-07-08T22:00:00.000Z"

Buy me a coffee

ko-fi