reworked month-picker
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user