Gathering detailed insights and metrics for vue-datetime-datestime-disable
Gathering detailed insights and metrics for vue-datetime-datestime-disable
Gathering detailed insights and metrics for vue-datetime-datestime-disable
Gathering detailed insights and metrics for vue-datetime-datestime-disable
Mobile friendly datetime picker for Vue. Supports date and datetime modes, i18n and more.
npm install vue-datetime-datestime-disable
Typescript
Module System
Node Version
NPM Version
60.5
Supply Chain
98.5
Quality
75
Maintenance
50
Vulnerability
99.6
License
JavaScript (76.66%)
Vue (23.34%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
982 Stars
254 Commits
244 Forks
11 Watchers
5 Branches
23 Contributors
Updated on Jul 05, 2025
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
vue-datetime-datestime-disable@1.0.1
Unpacked Size
158.78 kB
Size
29.44 kB
File Count
18
NPM Version
8.11.0
Node Version
16.16.0
Published on
Jun 16, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
66
Mobile friendly datetime picker for Vue. Supports date, datetime and time modes, i18n and more.
This is a personal for of the original project you can find at https://github.com/mariomka/vue-datetime
This version includes the following additional functionality:
disable-dates
disable-times
sub-title
disable-days
use-input
1yarn add luxon vue-datetime weekstart
Or
1npm install --save luxon vue-datetime weekstart
weekstart is optional, is used to get the first day of the week.
1import Vue from 'vue' 2import { Datetime } from 'vue-datetime' 3// You need a specific loader for CSS files 4import 'vue-datetime/dist/vue-datetime.css' 5 6Vue.use(Datetime)
1import { Datetime } from 'vue-datetime'; 2 3Vue.component('datetime', Datetime);
1import { Datetime } from 'vue-datetime'; 2 3Vue.extend({ 4 template: '...', 5 components: { 6 datetime: Datetime 7 } 8});
Download vue, luxon, weekstart and vue-datetime or use a CDN like unpkg.
1<link rel="stylesheet" href="vue-datetime.css"></link> 2<script src="vue.js"></script> 3<script src="luxon.js"></script> 4<script src="weekstart.js"></script> 5<script src="vue-datetime.js"></script>
The component registers itself automatically as <datetime>
. If you want to use a different name then register it explicitly:
1Vue.component('vue-datetime', window.VueDatetime.Datetime);
weekstart is optional, is used to get the first day of the week.
1<datetime v-model="date"></datetime>
Parameter | Type | Default | Description |
---|---|---|---|
v-model (required) | ISO 8601 String | - | Datetime. |
type | String | date | Picker type: date, datetime or time. |
use-input | Boolean | true | Whether or not to use and show an input. If you set this to false, you need to set ref on datetime and trigger it to open in your code with this.$refs.datetime.open() |
input-id | String | '' | Id for the input. |
input-class | String , Array or Object | '' | Class for the input. |
input-style | String , Array or Object | '' | Style for the input. |
hidden-name | String | null | Name for hidden input with raw value. See #51. |
value-zone | String | UTC | Time zone for the value. |
zone | String | local | Time zone for the picker. |
format | Object or String | DateTime.DATE_MED , DateTime.DATETIME_MED or DateTime.TIME_24_SIMPLE | Input date format. Luxon presets or tokens. |
phrases | Object | {ok: 'Ok', cancel: 'Cancel'} | Phrases. |
use12-hour | Boolean | false | Display 12 hour (AM/PM) mode |
hour-step | Number | 1 | Hour step. |
minute-step | Number | 1 | Minute step. |
min-datetime | ISO 8601 String | null | Minimum datetime. |
max-datetime | ISO 8601 String | null | Maximum datetime. |
disabled-days | Array | [] | Days to disable in date picker (should match weekstart numbering - ie 6 is Saturday, 7 is Sunday). Example [6, 7] |
disabled-dates | Array | [] | Specific dates to disable in date picker (.toISODate() format). Example ['2022-12-31'] Also supports just the date (without year). Example ['12-31'] |
disabled-times | Array | [] | Specific time ranges to disable, in 24 hour (military time) format, without zero padding. Example ["0:0-8:59", "19:1-24:0"] |
auto | Boolean | false | Auto continue/close on select. |
week-start | Number | auto from locale if weekstart is available or 1 | First day of the week. 1 is Monday and 7 is Sunday. |
flow | Array | Depends of type | Customize steps flow, steps available: time, date, month, year. Example: ['year', 'date', 'time'] |
title | String | '' | Popup title. |
sub-title | String | '' | Popup sub-title (below date) |
hide-backdrop | Boolean | false | Show/Hide backdrop. |
backdrop-click | Boolean | true | Enable/Disable backdrop click to cancel (outside click). |
Input inherits all props not defined above but style
and class
will be inherited by root element. See inheritAttrs option
The component is based on Luxon, check out documentation to set time zones and format.
Date internationalization depends on luxon. Set the default locale.
1import { Settings } from 'luxon' 2 3Settings.defaultLocale = 'es'
Component emits the input
event to work with v-model
. More info.
close
event is emitted when the popup closes.
Also, input text inherits all component events.
You can customize the component using named slots.
Available slots: before
, after
, button-cancel
and button-confirm
1<datetime v-model="date" input-id="startDate"> 2 <label for="startDate" slot="before">Field Label</label> 3 <span class="description" slot="after">The field description</span> 4 <template slot="button-cancel"> 5 <fa :icon="['far', 'times']"></fa> 6 Cancel 7 </template> 8 <template slot="button-confirm"> 9 <fa :icon="['fas', 'check-circle']"></fa> 10 Confirm 11 </template> 12</datetime>
You can also use slot-scope
to determine which view is currently active:
1<template slot="button-confirm" slot-scope="scope"> 2 <span v-if='scope.step === "date"'>Next <i class='fas fa-arrow-right' /></span> 3 <span v-else><i class='fas fa-check-circle' /> Publish</span> 4</template>
Theming is supported by overwriting CSS classes.
1yarn test
1yarn dev
Bundle the js and css to the dist
folder:
1yarn build
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 9/27 approved changesets -- score normalized to 3
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
181 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More