Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/app/pages/Components/Datepicker/Datepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@
type: 'Number',
description: 'Debounces the conversion of plaintext into a date object. Set to a longer time if your users type slowly, or shorter if your users type really fast.',
defaults: 1000
}
},
{
name: 'md-disabled',
type: 'Boolean',
description: 'Disables the entire datepicker',
defaults: 'false'
},
]
},
events: {
Expand Down
9 changes: 8 additions & 1 deletion src/components/MdDatepicker/MdDatepicker.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<md-field :class="['md-datepicker', { 'md-native': !this.mdOverrideNative }]" md-clearable>
<md-date-icon class="md-date-icon" @click.native="toggleDialog" />
<md-input :type="type" ref="input" v-model="inputDate" @focus.native="onFocus" :pattern="pattern" />
<md-input :disabled="mdDisabled" :type="type" ref="input" v-model="inputDate" @focus.native="onFocus" :pattern="pattern" />

<slot />

Expand Down Expand Up @@ -45,6 +45,10 @@
props: {
value: [String, Number, Date],
mdDisabledDates: [Array, Function],
mdDisabled: {
type: Boolean,
default: false,
},
mdOpenOnFocus: {
type: Boolean,
default: true
Expand Down Expand Up @@ -178,6 +182,9 @@
},
methods: {
toggleDialog () {
if (this.mdDisabled) {
return;
}
if (!isFirefox || this.mdOverrideNative) {
this.showDialog = !this.showDialog
if (this.showDialog) {
Expand Down