0

I'm making a search box using Vue and KendoUI. I want to set my DatePicker to empty at first. If necessary, I would like to enter a value and I need to get formatted value.(e.g.,YYYYMMDD)

  1. The input at the start should be empty.
  2. When entering a value, the return value must be formatted.
  3. don't use Jquery

Thank you for reading it

//can't get formatted value

<template>
<kendo-datepicker
    v-model="test.day"
    :format="'yyyy-MM-dd'"
    :parse-formats="['yyyyMMdd']"
></kendo-datepicker>
</template>
.....
<script>
.....
    data: function() {
        return {
            test: {
                day: "",
            },
        };
    },
.....
</script>

//I want to set value to empty.

<template>
<kendo-datepicker
    v-model="test.day"
    :format="'yyyy-MM-dd'"
    :parse-formats="['yyyyMMdd']"
></kendo-datepicker>
</template>
.....
<script>
.....
    data: function() {
        return {
            test: {
                day: dayjs().format("YYYYMMDD"), 
            },
        };
    },
.....
</script>

1 Answers1

-1

have you tried using:

$("#datepicker").val('')

I think these two questions are similar to yours and would help to read through them, so I am sharing them here.

Shinwi
  • 69
  • 1
  • 7