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 () => {
|
||||
await nextTick();
|
||||
const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`);
|
||||
if (todayCell) {
|
||||
todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
};
|
||||
|
||||
const formatDateForAttribute = (dateValue) => {
|
||||
if (dateValue instanceof Date) return date.formatDate(dateValue, 'YYYY-MM-DD');
|
||||
return dateValue;
|
||||
const todayCell = document.querySelector(
|
||||
`td[data-date="${date.formatDate(today, 'YYYY-MM-DD')}"]`,
|
||||
);
|
||||
if (todayCell) todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
};
|
||||
|
||||
async function updateWarehouse(warehouseFk) {
|
||||
|
@ -242,7 +237,7 @@ async function updateWarehouse(warehouseFk) {
|
|||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-date="{ row }">
|
||||
<QTd @click.stop :data-date="formatDateForAttribute(row.shipped)">
|
||||
<QTd @click.stop :data-date="row?.shipped.substring(0, 10)">
|
||||
<QBadge
|
||||
v-bind="getBadgeAttrs(row.shipped)"
|
||||
class="q-ma-none"
|
||||
|
|
Loading…
Reference in New Issue