2022-07-06 06:57:55 +00:00
|
|
|
<template>
|
2022-08-07 05:12:52 +00:00
|
|
|
<b-field class="column" :label="`Selecciona la hora ${tipo}`">
|
|
|
|
<b-clockpicker
|
|
|
|
hour-format="24"
|
|
|
|
locale="es-ES"
|
|
|
|
type="is-info"
|
|
|
|
:min-time="minTime"
|
|
|
|
:max-time="maxTime"
|
|
|
|
v-model="hora"
|
|
|
|
inline
|
|
|
|
/>
|
|
|
|
</b-field>
|
2022-07-06 06:57:55 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import moment from 'moment'
|
2022-08-07 05:12:52 +00:00
|
|
|
|
2022-07-06 06:57:55 +00:00
|
|
|
export default {
|
|
|
|
props: {
|
2022-08-07 05:12:52 +00:00
|
|
|
horaStr: { type: String, required: true, default: '' },
|
|
|
|
tipo: { type: String, required: true, default: '' },
|
2022-07-06 06:57:55 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2022-08-07 05:12:52 +00:00
|
|
|
minTime: new Date(`${moment().format('DD-MM-YYYY')} 07:00`),
|
|
|
|
maxTime: new Date(`${moment().format('DD-MM-YYYY')} 20:00`),
|
|
|
|
hora: new Date(),
|
2022-07-06 06:57:55 +00:00
|
|
|
}
|
|
|
|
},
|
2022-08-07 05:12:52 +00:00
|
|
|
watch: {
|
|
|
|
hora(horaSeleccionada) {
|
|
|
|
this.$emit('hora-seleccionada', horaSeleccionada)
|
2022-07-06 06:57:55 +00:00
|
|
|
},
|
|
|
|
},
|
2022-07-06 19:52:10 +00:00
|
|
|
created() {
|
2022-08-07 05:12:52 +00:00
|
|
|
if (this.horaStr)
|
|
|
|
this.hora = new Date(`${moment().format('DD-MM-YYYY')} ${this.horaStr}`)
|
2022-07-06 19:52:10 +00:00
|
|
|
},
|
2022-07-06 06:57:55 +00:00
|
|
|
}
|
|
|
|
</script>
|