Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startFrom is not honored when dateValue is passed #68

Open
acidjazz opened this issue Apr 19, 2022 · 0 comments
Open

startFrom is not honored when dateValue is passed #68

acidjazz opened this issue Apr 19, 2022 · 0 comments

Comments

@acidjazz
Copy link

acidjazz commented Apr 19, 2022

If I pass a dateValue of today, but make the start date last month, it ignores that.

Any way around this?

<template>
  <litepie-datepicker v-model="dateValue" :start-from="startFrom" :formatter="formatter" />
</template>

<script lang="ts" setup>
import LitepieDatepicker from 'litepie-datepicker'

const { $dayjs } = useNuxtApp()

const dateValue = ref([
  $dayjs().format('MM-DD-YYYY'),
  $dayjs().format('MM-DD-YYYY'),
])

const formatter = ref({
  date: 'MM-DD-YYYY',
  month: 'MMM',
})

const current = new Date()
const startFrom = ref(new Date(current.setMonth(current.getMonth()-1)))

</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant