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

vue-time-date-range-picker-vue3

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-time-date-range-picker-vue3

a vue time date range picker

  • 1.4.17
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
80
decreased by-47.71%
Maintainers
1
Weekly downloads
 
Created
Source

codecov

vue-time-date-range-picker

A Vue Component to pick a ranged datetime in calendar. Built alongside Vue 2.x . This datepicker utilize moment for translations.

Demo

codepen demo : https://codepen.io/limbara/pen/ZEQxoZZ sandbox demo : https://codesandbox.io/s/example-vue-time-date-range-picker-byw7g

Clone the repo and run 'npm install && npm run serve' for local demo

Install

npm i vue-time-date-range-picker

Usage

Usage within JS project

import DatePicker, { CalendarDialog } from 'vue-time-date-range-picker/dist/vdprDatePicker'

export default {
  //...
  components: {
    DatePicker,
    CalendarDIalog
  }
  //...
}

You can use CalendarDialog Component if you want to implement your own input element

Usage from CDN

<div id="app">
  <datepicker></datepicker>
</div>
<script src="https://unpkg.com/vue"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.27.0/moment-with-locales.min.js"></script>
<script src="https://unpkg.com/vue-time-date-range-picker@1.2.0/dist/vdprDatePicker.js"></script>
<script>
const app = new Vue({
  el: '#app',
  components: {
    'datepicker' : vdprDatePicker.default,
    'calendar-dialog' : vdprDatePicker.CalendarDialog
  }
})
</script>

Available props

Below is props that're available in DatePicker Component

** date format refer to moment **

PropTypeDefaultDescription
initial-dates[Date, Date]Initial value for the datepicker
inlineBooleanfalseUse datepicker inline style
languageStringenLanguange
formatStringDD/MM/YYYY HH:mmFormat for display date input
same-date-formatObjectrefer belowFormat for display date input if start & end date same
disabled-datesObjectrefer belowDisable certain dates
date-inputObjectInput configuration
show-helper-buttonsBooleanShow helper buttons
helper-buttons[ ]ObjectCustom helper button
calendar-date-inputObjectrefer belowCalendar input date configuration
calendar-time-inputObjectrefer belowCalendar input time configuration
switch-button-labelStringSwitch Button label
switch-button-initialBooleanSwitch Button initial value
apply-button-labelStringApply Button Label
reset-button-labelStringReset Button Label
is-monday-firstBooleanCalendar start from Monday instead of Sunday

Below is props that're available in Calendar Dialog Component

PropTypeDefaultDescription
initial-dates[Date, Date]Initial value for the datepicker
inlineBooleanfalseUse datepicker inline style
languageStringenLanguange
disabled-datesObjectrefer belowDisable certain dates
show-helper-buttonsBooleantrueShow helper buttons
helper-buttons[ ]Object[ ]Custom helper button
date-inputObjectCalendar input date configuration
time-inputObjectCalendar input time configuration
switch-button-labelStringAll DaysSwitch Button label
switch-button-initialBooleanfalseSwitch Button initial value
apply-button-labelStringApplyApply Button Label
reset-button-labelStringResetReset Button Label
is-monday-firstBooleanfalseCalendar start from Monday (default Sunday)
Same Date Format

Below is values that're available for props "same-date-format"

KeyTypeDefaultDescription
fromStringDD/MM/YYYY, HH:mmformat selected start date
toStringHH:mmformat selected end date
Date Input

Below is values that're available for props "date-input"

KeyTypeDefaultDescription
inputClassString|Array|Objectclass for input element
refNameStringref name for input element
nameStringattribute name
placeholderStringattribute placeholder
idStringatttibute id
requiredBooleanattirbute required
Disabled Dates

Below is values that're available for props "disabled-dates"

KeyTypeDefaultDescription
dates[ ]Datedisable dates matching array of Date object
fromDatedisable dates from this date
toDatedisable dates until this date
rangesObjectdisable dates matching object of date "from" & "to"
customFunctiondisable dates with function
Helper Buttons

Below is values that're available for props "helper-buttons"

KeyTypeDefaultDescription
nameStringbutton name
fromStringformat selected start date
toStringformat selected end date
C Date Input

Below is values that're available for props "calendar-date-input" or "date-input" for Calendar Dialog component

KeyTypeDefaultDescription
labelStartsStringStartsstart date label
labelEndsStringEndsends date label
inputClassString|Array|Objectclass for input element
formatStringDD/MM/YYYYdate format
C Time Input

Below is values that're available for props "calendar-time-input" or "time-input" for Calendar Dialog component

KeyTypeDefaultDescription
inputClassString|Array|Objectclass for input element
readonlyBooleanfalseattribute readonly
stepNumber60step value in minutes

Events

Below is events that're available in DatePicker Component

EventOutputDescription
date-appliedDate, DateDates is applied to date input. Output start & end date
on-prev-calendarOn calendar page previous
on-next-calendarOn calendar page next
datepicker-openedDatepicker is opened
datepicker-closedDatepicker is closed
select-dateDate, DateA date is selected in calendar. Output start & end date
select-disabled-dateDateA disabled date is selected in calendar

Below is events that're available in Calendar Dialog Component

EventOutputDescription
on-applyDate, DateDates is applied to date input. Output start & end date
on-prev-calendarOn calendar page previous
on-next-calendarOn calendar page next
select-dateDate, DateA date is selected in calendar. Output start & end date
select-disabled-dateDateA disabled date is selected in calendar

Translations

** available languages refer to moment **

Keywords

FAQs

Package last updated on 13 Aug 2021

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