Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue2-datepicker

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue2-datepicker

A Datepicker Component For Vue2

  • 1.9.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
83K
decreased by-0.35%
Maintainers
1
Weekly downloads
 
Created
Source

vue2-datepicker

中文版

A Datepicker Component For Vue2

Demo

https://mengxiong10.github.io/vue2-datepicker/

image

Install

$ npm install vue2-datepicker --save

Usage

<script>
import DatePicker from 'vue2-datepicker'

export default {
  components: { DatePicker },
  data() {
    return {
      time1: '',
      time2: '',
      shortcuts: [
        {
          text: 'Today',
          start: new Date(),
          end: new Date()
        }
      ]
    }
  }
}
</script>

<template>
  <div>
    <date-picker v-model="time1" :first-day-of-week="1"></date-picker>
    <date-picker v-model="time2" range :shortcuts="shortcuts"></date-picker>
  </div>
</template>

Attributes

PropTypeDefaultDescription
typeString'date'select datepicker or datetimepicker(date/datetime)
rangeBooleanfalseif true, the type is daterange or datetimerange
confirmBooleanfalseif true, need click the button to change the value
formatStringyyyy-MM-ddDate formatting string
langStringzhTranslation (en/zh/es/pt-br/fr/ru/de/it/cs)
placeholderStringinput placeholder text
widthString/Number210input size
disabled-daysArray[]Days in YYYY-MM-DD format to disable
not-beforeString/Date''Disable all dates before new Date(not-before)
not-afterString/Date''Disable all dates after new Date(not-after)
shortcutsBoolean/Arraytruethe shortcuts for the range picker
time-picker-optionsObject{}set timePickerOptions(start, step, end)
minute-stepNumber0if > 0 don't show the second picker(0 - 60)
first-day-of-weekNumber7set the first day of week (1-7)
input-classString'mx-input'the input class name
confirm-textString'OK'the default text to display on confirm button
disabledBooleanfalseDisable the component
editableBooleanfalseif true, user can type it(only the range is false)
shortcuts
  • true - show the default shortcuts
  • false - hide the shortcuts
  • Object[] - custom shortcuts, [{text, start, end}]
PropTypeDescription
textStringText
startDateStart Date
endDateEnd Date
time-picker-options
  • Object[] - custom time-picker, [{start, step, end}]
PropTypeDescription
startStringstartTime (eg '00:00')
stepStringstepTime (eg '00:30')
endStringendTime (eg '23:30')

Events

NameDescriptionCallback Arguments
changeWhen user select datethe currentValue
confirmWhen user click 'OK' buttonthe currentValue

License

MIT

Copyright (c) 2017-present xiemengxiong

Keywords

FAQs

Package last updated on 22 Mar 2018

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