Socket
Socket
Sign inDemoInstall

vue-ctk-date-time-picker

Package Overview
Dependencies
Maintainers
3
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-ctk-date-time-picker

A vue component for select date & time (by Chronotruck)


Version published
Weekly downloads
18K
decreased by-2.81%
Maintainers
3
Weekly downloads
 
Created
Source

vue-ctk-date-time-picker

vue-ctk-date-time-picker

A vue component for select dates (range mode available) & time

vue-ctk-date-time-picker

Dark mode

vue-ctk-date-time-picker

Demo

Enjoy here

Installation

Yarn yarn add vue-ctk-date-time-picker NPM npm i --save vue-ctk-date-time-picker

Usage

ES6 Modules / CommonJS

import VueCtkDateTimePicker from 'vue-ctk-date-time-picker';
import 'vue-ctk-date-time-picker/dist/vue-ctk-date-time-picker.css';

Vue.component('vue-ctk-date-time-picker', VueCtkDateTimePicker);
<vue-ctk-date-time-picker></vue-ctk-date-time-picker>

UMD

<vue-ctk-date-time-picker></vue-ctk-date-time-picker>

<script src="https://unpkg.com/vue" charset="utf-8"></script>
<script src="./dist/vue-ctk-date-time-picker.umd.min.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="./dist/vue-ctk-date-time-picker.css">

<script type="text/javascript">
  Vue.component('vue-ctk-date-time-picker', window.VueCtkDateTimePicker.default);
</script>

Here is an example of UMD implementation: https://codepen.io/louismazel/pen/jQWNzQ

Props API

PropsTypeRequiredDefault
v-modelString/Intyes-
labelStringnoSelect date & time
hint (1)textno-
error-hint (2)Booleannofalse
color (3)String (hex)nododgerblue
minute-intervalIntno1
formattedstringno'llll' (momentjs format)
formatstringno-
time-formatstringno'H:mm a'
locale (4)stringnoBrowser Locale
time-zone (5)stringnoBrowser Time Zone
disable-timeBooleannofalse
disable-dateBooleannofalse
without-headerBooleannofalse
idstringnoCtkDateTimePicker
overlayBooleannotrue
min-date (6)stringno-
max-date (6)stringno-
no-weekends-daysBooleannofalse
auto-closeBooleannofalse
without-inputBooleannofalse
overlay-backgroundBooleannofalse
disabled-dates (7)Booleanno[]
range-modeBooleannofalse
darkBooleannofalse
without-range-shortcutBooleannofalse
shortcuts-translation (8)Objectno-
disabled-hours (9)Array (of String)no-

(1) hint : Is a text that replaces the label/placeholder

(2) error-hint : When is true --> Input border & label are red

(3) color: Replace color for the hint, the borders & time selected in dropdown

(4) locale : Default value is the locale of the browser - Ex : Set locale="fr" to force to French language

(5) time-zone : Default value is the time-zone of the browser - Ex : Set Europe/Paris to force to French TZ. Do not forget to use a format like this YYYY-MM-DDTHH:mm:ssZ to get the TZ

(6) min-date & max-date : Must be 'YYYY-MM-DD' format

(7) Disabled-Dates is an Array of dates in 'YYYY-MM-DD' format (ex: ['2018-04-03', '2018-04-07', '2018-04-09'])

(8) shortcuts-translation : Must be an Object like that

{
  "this_week": "This week",
  "last_7_days": "Last 7 days",
  "last_30_days": "Last 30 days",
  "this_month": "This month",
  "last_month": "Last month",
  "this_year": "This year",
  "last_year": "Last year"
}

(9) disabled-hours : Must be an Array of hours in 24h format ('00' to '23') : ['00','01','02','03','04','05','06','07','19','20','21','22','23']

Upcoming features (Todo)

  • Disable specific hours & minutes on TimePicker
  • Custom shortcuts on RangeDatePicker
  • UI Improvements for TimePicker (Issue #35)
  • Custom elements for trigger the component
  • Double Calendar on RangeDatePicker
  • Inputs Text to choose values (Issue #30)
  • Keyboard Accessibility
  • Select Year directly on DatePicker

Contribution

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run serve

Build

To build just run: npm run build:lib

Tests

Work in progress

License

This project is licensed under MIT License

Keywords

FAQs

Package last updated on 14 Dec 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