New Jun 12, 2025

How to convert time-only input to full DateTime object using VueDatePicker?

Libraries, Frameworks, etc. All from Newest questions tagged vue.js - Stack Overflow View How to convert time-only input to full DateTime object using VueDatePicker? on stackoverflow.com

<template>
  <VueDatePicker
    v-model="deliveryTime"
    time-picker
  />
</template>

<script setup>
import { ref } from 'vue'

const deliveryTime = ref(new Date())

// later sent like:
const payload = {
  DeliveryTime: deliveryTime.value
}
</script>

The user selects only time (e.g., 15:50). What is the correct way to convert that into a full JavaScript DateTime object (with today’s date and selected time) to send to an ASP.NET Core backend and save in a SQL Server database?

Scroll to top