pcpuma_unam_operador/components/admin/Reloj.vue

41 lines
900 B
Vue
Raw Normal View History

2022-07-06 06:57:55 +00:00
<template>
<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-07-06 06:57:55 +00:00
export default {
props: {
horaStr: { type: String, required: true, default: '' },
tipo: { type: String, required: true, default: '' },
2022-07-06 06:57:55 +00:00
},
data() {
return {
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
}
},
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() {
if (this.horaStr)
2022-08-19 16:47:30 +00:00
this.hora = new Date(`${moment().format('YYYY-MM-DD')} ${this.horaStr}`)
2022-07-06 19:52:10 +00:00
},
2022-07-06 06:57:55 +00:00
}
</script>