changes
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
role="menu"
|
||||
@click="doClick()"
|
||||
>
|
||||
<div class="dropdown-content">
|
||||
<div class="dropdown-content px-2 w-xs">
|
||||
<PickDay
|
||||
v-bind="{ date, maxdate }"
|
||||
@date="selectDate"
|
||||
@@ -41,6 +41,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import PickDay from "@/components/datepicker/PickDay.vue";
|
||||
|
||||
const props = defineProps({
|
||||
record: Object,
|
||||
attr: String,
|
||||
@@ -51,7 +53,7 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
const emit = defineEmits(["date"]);
|
||||
const { $id, $copy, $dayjs, $empty } = useNuxtApp();
|
||||
const { $copy, $dayjs, $empty } = useNuxtApp();
|
||||
|
||||
const date = ref();
|
||||
const show = ref();
|
||||
@@ -144,8 +146,8 @@ function checkDate() {
|
||||
date.value = undefined;
|
||||
if ($empty(show.value)) return emit("date", null);
|
||||
show.value = getDate(show.value);
|
||||
let val = `${show.value.substring(6, 10)}-${show.value.substring(3, 5)}-${show.value.substring(0, 2)}`;
|
||||
if ($dayjs(val, "YYYY-MM-DD", true).isValid()) {
|
||||
const val = `${show.value.substring(6, 10)}/${show.value.substring(3, 5)}/${show.value.substring(0, 2)}`;
|
||||
if ($dayjs(val, "YYYY/MM/DD", true).isValid()) {
|
||||
date.value = val;
|
||||
emit("date", date.value);
|
||||
} else error.value = true;
|
||||
|
||||
Reference in New Issue
Block a user