started working on adding employees to schedule
This commit is contained in:
@@ -2,20 +2,36 @@
|
|||||||
|
|
||||||
h1(v-if="isValid(startDate)") {{format(startDate, "MMMM y", {locale: de})}}
|
h1(v-if="isValid(startDate)") {{format(startDate, "MMMM y", {locale: de})}}
|
||||||
|
|
||||||
table(class='table' v-for="(row, rIndex) in dates" :key="rIndex")
|
table(class='table table-sm' v-for="(row, rIndex) in dates" :key="rIndex")
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
td(v-for="(day, index) in weekdays" :key="index") {{ day }}
|
td(style="width: 200px")
|
||||||
|
td(v-for="(day, index) in weekdays" :key="index" :class="{'text-body text-opacity-25' : row[index] === null}") {{ day }}
|
||||||
tr
|
tr
|
||||||
|
td
|
||||||
td(v-for="(date, dIndex) in row" :key="dIndex")
|
td(v-for="(date, dIndex) in row" :key="dIndex")
|
||||||
template(v-if="date !== null") {{ format(date, "dd.MM.")}}
|
template(v-if="date !== null") {{ format(date, "dd.MM.")}}
|
||||||
tbody
|
tbody
|
||||||
tr
|
tr()
|
||||||
|
td {{}}
|
||||||
td(v-for="(date, dIndex) in row" :key="dIndex")
|
td(v-for="(date, dIndex) in row" :key="dIndex")
|
||||||
|
tr()
|
||||||
|
td(style="width: 250px")
|
||||||
|
o-autocomplete(
|
||||||
|
:keep-first="true"
|
||||||
|
:open-on-focus="true"
|
||||||
|
inputClass="form-control form-control-sm"
|
||||||
|
)
|
||||||
|
td(v-for="(date, dIndex) in row" :key="dIndex")
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { toRef, computed, ref } from 'vue'
|
import { toRef, computed, ref } from 'vue'
|
||||||
|
import { storeToRefs } from 'pinia'
|
||||||
|
import { useEmployees } from '/src/stores/employees.js'
|
||||||
import { addMonths, subDays, addDays, format, getISODay, isValid, eachDayOfInterval } from 'date-fns'
|
import { addMonths, subDays, addDays, format, getISODay, isValid, eachDayOfInterval } from 'date-fns'
|
||||||
import { de } from 'date-fns/locale'
|
import { de } from 'date-fns/locale'
|
||||||
|
|
||||||
@@ -34,7 +50,7 @@ table(class='table' v-for="(row, rIndex) in dates" :key="rIndex")
|
|||||||
* Local variables
|
* Local variables
|
||||||
*/
|
*/
|
||||||
const weekdays : string[] = doubleWeekdays()
|
const weekdays : string[] = doubleWeekdays()
|
||||||
const employees : string[] = ['Pascal', 'Karin', 'Sandra']
|
const { employees } = storeToRefs(useEmployees())
|
||||||
|
|
||||||
const daysInMonth : Date[] = eachDayOfInterval({
|
const daysInMonth : Date[] = eachDayOfInterval({
|
||||||
start: startDate.value,
|
start: startDate.value,
|
||||||
@@ -60,6 +76,10 @@ table(class='table' v-for="(row, rIndex) in dates" :key="rIndex")
|
|||||||
start = addDays(start, 1)
|
start = addDays(start, 1)
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
while (i < 14) {
|
||||||
|
row.push(null)
|
||||||
|
i++
|
||||||
|
}
|
||||||
arr.push(row)
|
arr.push(row)
|
||||||
row = []
|
row = []
|
||||||
i = 0
|
i = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user