fix data limit bug (#392)

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Favour Olayinka 2024-05-01 11:39:46 +01:00 committed by GitHub
parent 8cca48e419
commit 301aec9ed6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -93,7 +93,7 @@ import InputWrapper from './components/InputWrapper.vue'
import { getCurrentInstance } from 'vue' import { getCurrentInstance } from 'vue'
import { DatePicker } from 'v-calendar' import { DatePicker } from 'v-calendar'
import 'v-calendar/dist/style.css' import 'v-calendar/dist/style.css'
import { format } from 'date-fns' import { format, startOfDay, endOfDay } from 'date-fns'
import { tailwindcssPaletteGenerator } from '~/lib/colors.js' import { tailwindcssPaletteGenerator } from '~/lib/colors.js'
const props = defineProps({ const props = defineProps({
@ -145,13 +145,13 @@ const inputClasses = computed(() => {
const minDate = computed(() => { const minDate = computed(() => {
if (props.disablePastDates) { if (props.disablePastDates) {
return new Date() return startOfDay(new Date())
} }
return undefined return undefined
}) })
const maxDate = computed(() => { const maxDate = computed(() => {
if (props.disableFutureDates) { if (props.disableFutureDates) {
return new Date() return endOfDay(new Date())
} }
return undefined return undefined
}) })