reworked month-picker

This commit is contained in:
Sockenklaus
2021-10-03 12:12:04 +02:00
parent 51c9b3ea9e
commit 1ed7cdada8
3 changed files with 41 additions and 60 deletions

View File

@@ -15,7 +15,7 @@ table(class='table' v-for="(row, rIndex) in dates" :key="rIndex")
</template>
<script setup lang="ts">
import { toRef, computed } from 'vue'
import { toRef, computed, ref } from 'vue'
import { addMonths, subDays, addDays, format, getISODay, isValid, eachDayOfInterval } from 'date-fns'
import { de } from 'date-fns/locale'
@@ -40,7 +40,7 @@ table(class='table' v-for="(row, rIndex) in dates" :key="rIndex")
start: startDate.value,
end: endDate.value
})
const offset : number = getISODay(startDate.value) - 1 + props.initialOffset
const offset = computed(() => getISODay(startDate.value) - 1 + props.initialOffset)
const dates = computed( () => {
@@ -50,7 +50,7 @@ table(class='table' v-for="(row, rIndex) in dates" :key="rIndex")
let end = endDate.value
let i
for (i = 0; i < offset ; i++) {
for (i = 0; i < offset.value ; i++) {
row.push(null)
}