Merge pull request 'refactor: refs #8697 simplify date handling in ItemDiary component' (!1532) from 8697-fixScrollToView into test
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #1532 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
f189a9912c
|
@ -158,15 +158,10 @@ const getBadgeAttrs = (_date) => {
|
||||||
|
|
||||||
const scrollToToday = async () => {
|
const scrollToToday = async () => {
|
||||||
await nextTick();
|
await nextTick();
|
||||||
const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`);
|
const todayCell = document.querySelector(
|
||||||
if (todayCell) {
|
`td[data-date="${date.formatDate(today, 'YYYY-MM-DD')}"]`,
|
||||||
todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
);
|
||||||
}
|
if (todayCell) todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
};
|
|
||||||
|
|
||||||
const formatDateForAttribute = (dateValue) => {
|
|
||||||
if (dateValue instanceof Date) return date.formatDate(dateValue, 'YYYY-MM-DD');
|
|
||||||
return dateValue;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
async function updateWarehouse(warehouseFk) {
|
async function updateWarehouse(warehouseFk) {
|
||||||
|
@ -242,7 +237,7 @@ async function updateWarehouse(warehouseFk) {
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-date="{ row }">
|
<template #body-cell-date="{ row }">
|
||||||
<QTd @click.stop :data-date="formatDateForAttribute(row.shipped)">
|
<QTd @click.stop :data-date="row?.shipped.substring(0, 10)">
|
||||||
<QBadge
|
<QBadge
|
||||||
v-bind="getBadgeAttrs(row.shipped)"
|
v-bind="getBadgeAttrs(row.shipped)"
|
||||||
class="q-ma-none"
|
class="q-ma-none"
|
||||||
|
|
Loading…
Reference in New Issue