New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mathieustan/vue-datepicker

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mathieustan/vue-datepicker

A clean datepicker made with VueJs

  • 0.1.0-rc.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

vue-datepicker

codecov

A datepicker Vue component. Compatible with Vue 2.x

Demo

To view a demo online: https://vue-datepicker.netlify.com/

Install

npm install @mathieustan/vue-datepicker --save

or

yarn add @mathieustan/vue-datepicker
import { VueDatePicker } from '@mathieustan/vue-datepicker';

export default {
  // ...
  components: {
    VueDatePicker
  }
  // ...
}

or

import VueDatePicker from '@mathieustan/vue-datepicker';

Vue.use(VueDatePicker);

Usage

<VueDatePicker v-model="currentDate" />

value prop if passed should be a Date object

<template>
    <VueDatePicker :value="date"></VueDatePicker>
</template>
<script>
export default {
  // ...
  components: {
    VueDatePicker
  },
  data: () => ({
      date: new Date([2019, 5, 16]),
  }),,
  // ...
}
</script>

support name attribute for normal html form submission

<VueDatePicker :value="state.date" name="uniquename"></VueDatePicker>

Using v-model

<VueDatePicker v-model="state.date" name="uniquename"></VueDatePicker>

Available props

PropTypeDefaultDescription
idString'datepicker'Input id
valueDate|String|NumberDate value of the datepicker
nameString'datepicker'Input name property
typeString'date'Determines the type of the picker - date/month/quarter
formatStringDD MMMM YYYYDate formatting for input
formatHeaderStringdddd DD MMMAllows you to customize the format of the month string that appears in the header of the calendar.
formatOutputStringYYYY-MM-DDAllows you to customize the format of date when selected
localeObject{lang: 'en'}More informations here Translations
visibleBooleanfalseAllow you to trigger datepicker
placeholderString'YYYY-MM-DD'Allow you to change input placeholder
colorString#4f88ffApplies specified color
minDateString|Number|DateDate are available FROM this date
endDateString|Number|DateDate are disabled AFTER this date
disabledBooleanfalseDatepicker disabled or not
inlineBooleanfalseInline datepicker
fullscreenMobileBooleanfalseDatepicker will appear in a bottom sheet in mobile view
tabindexString|Number'0'Specify input tabindex
zIndexNumberSpecify a z-index to datepicker & overlay
attachToString'#app'It will mount datepicker popup into this element as a child

Events

EventOutputDescription
onOpendatepicker opened
onClosedatepicker closed
onChangedatepicker changed
onDestroydatepicker destroyed

Date Formatting

You can use this with format props.

Example :

<VueDatePicker v-model="currentDate" format="YYYY-MM-DD" />
FormatOutputDescription
YY18Two-digit year
YYYY2018Four-digit year
M1-12Month, beginning at 1
MM01-12Month, 2-digits
MMMJan-DecThe abbreviated month name
MMMMJanuary-DecemberThe full month name
D1-31Day of month
DD01-31Day of month, 2-digits
H0-23Hours
HH00-23Hours, 2-digits
h1-12Hours, 12-hour clock
hh01-12Hours, 12-hour clock, 2-digits
m0-59Minutes
mm00-59Minutes, 2-digits
s0-59Seconds
ss00-59Seconds, 2-digits
S0-9Hundreds of milliseconds, 1-digit
SS00-99Tens of milliseconds, 2-digits
SSS000-999Milliseconds, 3-digits
Z-5:00Offset from UTC
ZZ-0500Compact offset from UTC, 2-digits
AAM PMPost or ante meridiem, upper-case
aam pmPost or ante meridiem, lower-case
Do1st... 31stDay of Month with ordinal

Translations

By default, locale will be set from your navigator language. But it's possible to set it from locale props. Supported language : 'en', 'fr', 'es' in src/locale/translations

exemple:

<template>
    <VueDatePicker :value="date" :locale="locale"></VueDatePicker>
</template>
<script>
export default {
  // ...
  components: {
    VueDatePicker
  },
  data: () => ({
      date: new Date([2019, 5, 16]),
      locale: {
        lang: 'fr',
        weekDays: ['L', 'M', 'M', 'J', 'V', 'S', 'D'], // you can surcharge weekDays too
      },
  }),,
  // ...
}
</script>

Keywords

FAQs

Package last updated on 24 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc