Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/assets/vue/components/InputDate.vue

52 lines
1.0 KiB

<template>
<v-menu
v-model="showMenu"
:close-on-content-click="false"
:nudge-right="40"
transition="scale-transition"
offset-y
min-width="290px"
>
<template v-slot:activator="{ on }">
<v-text-field
v-model="date"
:label="label"
prepend-icon="mdi-calendar"
readonly
v-on="on"
></v-text-field>
</template>
<v-date-picker v-model="date" @input="handleInput"></v-date-picker>
</v-menu>
</template>
<script>
import { formatDateTime } from '../utils/dates';
export default {
props: {
label: {
type: String,
required: false,
default: () => ''
},
value: String
},
created() {
this.date = this.value ? this.value : this.date;
},
data() {
return {
date: this.value ? this.value : new Date().toISOString().substr(0, 10),
showMenu: false
};
},
methods: {
formatDateTime,
handleInput() {
this.showMenu = false;
this.$emit('input', this.date);
}
}
};
</script>