This commit is contained in:
2021-11-01 15:18:27 +00:00
parent f529a52db0
commit 27a9d6fd0c
3 changed files with 104 additions and 81 deletions

View File

@@ -2,42 +2,60 @@
<div>
<v-row>
<template v-if="!readonly">
<v-col cols="12">
<v-dialog v-model="dlgdate" width="300px">
<template v-slot:activator="{ on }">
<v-text-field
v-on="on"
prepend-icon="$ayiCalendarAlt"
@click:prepend="dlgdate = true"
<template v-if="!$store.state.nativeDateTimeInput">
<v-col cols="12">
<v-dialog v-model="dlgdate" width="300px">
<template v-slot:activator="{ on }">
<v-text-field
v-on="on"
prepend-icon="$ayiCalendarAlt"
@click:prepend="dlgdate = true"
:value="dateValue"
:label="label"
:rules="rules"
readonly
:error="!!hasErrors"
:data-cy="'dtfpick:' + testId"
></v-text-field>
</template>
<v-date-picker
:value="dateValue"
:label="label"
:rules="rules"
readonly
:error="!!hasErrors"
:data-cy="'dtfpick:' + testId"
></v-text-field>
</template>
<v-date-picker
:value="dateValue"
@input="updateDateValue"
:locale="languageName"
:data-cy="'dpick:' + testId"
>
<v-btn text color="primary" @click="$emit('input', null)">{{
$ay.t("Delete")
}}</v-btn>
<v-spacer></v-spacer>
@input="updateDateValue"
:locale="languageName"
:data-cy="'dpick:' + testId"
>
<v-btn text color="primary" @click="$emit('input', null)">{{
$ay.t("Delete")
}}</v-btn>
<v-spacer></v-spacer>
<v-btn text color="primary" @click="setToday()">{{
$ay.t("DateRangeToday")
}}</v-btn>
<v-spacer></v-spacer>
<v-btn text color="primary" @click="dlgdate = false">{{
$ay.t("OK")
}}</v-btn>
</v-date-picker>
</v-dialog>
</v-col>
<v-btn text color="primary" @click="setToday()">{{
$ay.t("DateRangeToday")
}}</v-btn>
<v-spacer></v-spacer>
<v-btn text color="primary" @click="dlgdate = false">{{
$ay.t("OK")
}}</v-btn>
</v-date-picker>
</v-dialog>
</v-col>
</template>
<template v-if="$store.state.nativeDateTimeInput">
<v-col cols="6">
<v-text-field
ref="dateField"
:value="dateValue"
@change="updateDateValue"
:readonly="readonly"
:disabled="disabled"
:label="label"
:rules="rules"
type="date"
:error-messages="errorMessages"
:data-cy="'dpick:' + testId"
></v-text-field>
</v-col>
</template>
</template>
<template v-else>
<v-col cols="12">