1.0.0 • Published 4 years ago

vue-weblineindia-time-picker v1.0.0

Weekly downloads
8
License
MLT
Repository
github
Last release
4 years ago

Vue Time picker component

A Vue Time picker component to select time or datetime.

Table of contents

Browser Support

ChromeFirefoxSafariEdgeIE
83.0 ✔77.0 ✔13.1.1 ✔83.0 ✔11.9 ✔

Demo

npm.io npm.io npm.io

Getting started

Install the npm package:

npm install vue-weblineindia-time-picker 
# OR 
yarn add vue-weblineindia-time-picker

Usage

Use the <vue-weblineindia-time-picker> component:

<template>
  <div>
   <Timepicker 
    id="time"
    v-model="time"
    placeholder="Time picker"
     />
  </div>
</template>

<script>
// import vue-weblineindia-time-picker
import Timepicker from 'vue-weblineindia-time-picker'
export default {
  components: {
    Timepicker

  },
  data(){
    return{
      time:""
    }
  },
</script>

Available Props

PropTypedefaultDescription
valueanynullValue of the component.
localestringenLocalization for different languages and formats is defined by binding the locale.
dateFormatstringmm/dd/yyEFormat of the date.
monthNavigatorbooleanfalseWhether the month should be rendered as a dropdown instead of text.
yearNavigatorbooleanfalseWhether the year should be rendered as a dropdown instead of text.
minDateDatenullThe minimum selectable date.
maxDateDatenullThe maximum selectable date.
disabledDatesarraynullArray with dates to disable.
disabledDaysarraynullArray with disabled weekday numbers.
showTimebooleantrueWhether to display timepicker.
timeOnlybooleanfalseWhether to display timepicker only.
hourFormatString12Specifies 12 or 24 hour format.
stepHourNumber1Hours to change per step.
stepMinuteNumber1Minutes to change per step.
stepSecondNumber1Seconds to change per step.
showSecondsbooleanfalseWhether to show the seconds in time picker.
timeSeparatorstring:Separator of time selector.
inlinebooleanfalseWhen enabled, displays the calendar as inline instead of an overlay.
showOtherMonthsbooleanfalseWhether to display dates in other months (non-selectable) at the start or end of the current month. To make these days selectable use the selectOtherMonths option.
selectOtherMonthsbooleanArray with disabled weekday numbers.Whether days in other months shown before or after the current month are selectable. This only applies if the showOtherMonths option is set to true.
numberOfMonthsnumber1Number of months to display.
viewstringdateType of view to display, valid valids are "date" for datepicker and "month" for month picker.
yearRangestring1960:2050The range of years displayed in the year drop-down in (nnnn:nnnn) format such as (2000:2020).
panelClassstringnullStyle class of the datetimepicker panel.
panelStylestringnullInline style of the datetimepicker panel.
maxDateCountnumbernullMaximum number of selectable dates in multiple mode.
showOnFocusbooleantrueWhen disabled, datepicker will not be visible with input focus.
autoZIndexbooleantrueWhether to automatically manage layering.
baseZIndexnumber0Base zIndex value to use in layering.
showButtonBarbooleanfalseWhether to display today and clear buttons at the footer
shortYearCutoffstring+10The cutoff year for determining the century for a date.
hideOnDateTimeSelectbooleanfalseWhether to hide the overlay on date selection when showTime is enabled.
showWeekbooleanfalseWhen enabled, calendar will show week numbers.
manualInputbooleanfalseWheter to allow prevents entering the date manually via typing.
ariaLabelledBystringnullEstablishes relationships between the component and label(s) where its value should be one or more element IDs.
appendTostringnullId of the element or "body" for document where the overlay should be appended to.
isDarkThemebooleanfalsedark theme for calendar

Methods

NameParametersDescription
date-selectvalue: Selected valueCallback to invoke when a date is selected.
show-Callback to invoke when datepicker panel is shown.
hide-Callback to invoke when datepicker panel is hidden.
today-clickdate: Today as a date instanceCallback to invoke when today button is clicked.
clear-clickevent: Click eventCallback to invoke when clear button is clicked.
month-changeevent.month: New month event.year: New yearCallback to invoke when a month is changed using the navigators.
year-changeevent.month: New month event.year: New yearCallback to invoke when a year is changed using the navigators.

Styling

Following is the list of structural style classes.

NameElement
p-calendarMain container element.
p-calendar-w-btnMain container element when button is enabled.
p-calendar-timeonlyMain container element in time picker only mode.
p-inputtextInput element.
p-datepickerDatepicker element.
p-datepicker-inlineDatepicker element in inline mode
p-monthpickerDatepicker element in month view.
p-monthpicker-monthMonth cell in month view mode.
p-datepicker-touch-uiDatepicker element in touch ui mode.
p-datepicker-calendarTable containing dates of a month.
p-datepicker-current-dayCell of selected date.
p-datepicker-todayCell of today's date.

Want to Contribute?

  • Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
  • Fork it.
  • Create new branch to contribute your changes.
  • Commit all your changes to your branch.
  • Submit a pull request.

Need Help?

We also provide a free, basic support for all users who want to use this VueJS TimePicker in their software project. In case you want to customize this Timepicker to suit your development needs, then feel free to contact our VueJS developers.


Collection of Components

We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development.


Changelog

Detailed changes for each release are documented in CHANGELOG.md.

Credits

vue-weblineindia-time-picker is inspired by primevue.

License

MIT

Keywords

vue-weblineindia-time-picker,calendar,time-picker,timepicker, vue components, vuejs, vuejs component