This commit is contained in:
@@ -18,6 +18,7 @@ TODO NEXT
|
|||||||
DATETIME
|
DATETIME
|
||||||
|
|
||||||
- Does it validate properly? NO. Get validation working!!
|
- Does it validate properly? NO. Get validation working!!
|
||||||
|
- https://baianat.github.io/vee-validate/concepts/components.html#how-it-works
|
||||||
- possibly helpful https://stackoverflow.com/questions/47982820/vuejs-vee-validate-in-custom-components
|
- possibly helpful https://stackoverflow.com/questions/47982820/vuejs-vee-validate-in-custom-components
|
||||||
- or https://duckduckgo.com/?q=vee+validate+with+custom+component&t=ffab&atb=v134-6__&ia=web
|
- or https://duckduckgo.com/?q=vee+validate+with+custom+component&t=ffab&atb=v134-6__&ia=web
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
v-model="formatDate"
|
v-model="formatDate"
|
||||||
v-bind:label="label"
|
v-bind:label="label"
|
||||||
readonly
|
readonly
|
||||||
|
:error="!(!error)"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</template>
|
</template>
|
||||||
<v-date-picker v-model="dateOnly" @input="dlgdate = false">
|
<v-date-picker v-model="dateOnly" @input="dlgdate = false">
|
||||||
@@ -22,7 +23,15 @@
|
|||||||
<v-flex xs6>
|
<v-flex xs6>
|
||||||
<v-dialog v-model="dlgtime" persistent lazy full-width width="290px">
|
<v-dialog v-model="dlgtime" persistent lazy full-width width="290px">
|
||||||
<template v-slot:activator="{ on }">
|
<template v-slot:activator="{ on }">
|
||||||
<v-text-field v-on="on" v-model="formatTime" label prepend-icon="fa-clock" @click:prepend="dlgtime = true" readonly></v-text-field>
|
<v-text-field
|
||||||
|
v-on="on"
|
||||||
|
v-model="formatTime"
|
||||||
|
label
|
||||||
|
prepend-icon="fa-clock"
|
||||||
|
@click:prepend="dlgtime = true"
|
||||||
|
readonly
|
||||||
|
:error="!(!error)"
|
||||||
|
></v-text-field>
|
||||||
</template>
|
</template>
|
||||||
<v-time-picker v-model="timeOnly">
|
<v-time-picker v-model="timeOnly">
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
@@ -38,6 +47,7 @@
|
|||||||
prepend-icon="fa-calendar-alt"
|
prepend-icon="fa-calendar-alt"
|
||||||
disabled
|
disabled
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
|
<p v-show="error" class="form__error v-messages theme--light error--text">{{ error }}</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -52,11 +62,23 @@ export default {
|
|||||||
throw "GzDateAndTimePicker: $gzlocale is required and missing";
|
throw "GzDateAndTimePicker: $gzlocale is required and missing";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
$_veeValidate: {
|
||||||
|
name() {
|
||||||
|
return this.label;
|
||||||
|
},
|
||||||
|
value() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
data: () => ({ date: null, dlgdate: false, dlgtime: false }),
|
data: () => ({ date: null, dlgdate: false, dlgtime: false }),
|
||||||
props: {
|
props: {
|
||||||
label: String,
|
label: String,
|
||||||
value: String,
|
value: String,
|
||||||
readonly: { type: Boolean, default: false }
|
readonly: { type: Boolean, default: false },
|
||||||
|
error: {
|
||||||
|
type: String,
|
||||||
|
required: false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
date() {
|
date() {
|
||||||
|
|||||||
@@ -57,6 +57,7 @@
|
|||||||
:error-messages="errors.collect('startDate')"
|
:error-messages="errors.collect('startDate')"
|
||||||
v-validate="'before:endDate'"
|
v-validate="'before:endDate'"
|
||||||
ref="startDate"
|
ref="startDate"
|
||||||
|
:error="errors.first('startDate')"
|
||||||
></gz-date-time-picker>
|
></gz-date-time-picker>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
|
|
||||||
@@ -68,6 +69,7 @@
|
|||||||
:error-messages="errors.collect('endDate')"
|
:error-messages="errors.collect('endDate')"
|
||||||
v-validate="'after:startDate'"
|
v-validate="'after:startDate'"
|
||||||
ref="endDate"
|
ref="endDate"
|
||||||
|
:error="errors.first('endDate')"
|
||||||
></gz-date-time-picker>
|
></gz-date-time-picker>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user