1
0
forked from test/crm

fix: apply timeAgo format for creation field

This commit is contained in:
Shariq Ansari 2023-11-28 12:39:11 +05:30
parent 21cbf2788a
commit da7ecc5c78
4 changed files with 12 additions and 4 deletions

View File

@ -44,7 +44,7 @@
<PhoneIcon class="h-4 w-4" /> <PhoneIcon class="h-4 w-4" />
</div> </div>
</template> </template>
<div v-if="column.key === 'modified'" class="truncate text-base"> <div v-if="['modified', 'creation'].includes(column.key)" class="truncate text-base">
{{ item.timeAgo }} {{ item.timeAgo }}
</div> </div>
</ListRowItem> </ListRowItem>

View File

@ -53,7 +53,7 @@
<PhoneIcon class="h-4 w-4" /> <PhoneIcon class="h-4 w-4" />
</div> </div>
</template> </template>
<div v-if="column.key === 'modified'" class="truncate text-base"> <div v-if="['modified', 'creation'].includes(column.key)" class="truncate text-base">
{{ item.timeAgo }} {{ item.timeAgo }}
</div> </div>
</ListRowItem> </ListRowItem>

View File

@ -77,7 +77,6 @@ import {
Dialog, Dialog,
Button, Button,
Dropdown, Dropdown,
createListResource,
createResource, createResource,
Breadcrumbs, Breadcrumbs,
} from 'frappe-ui' } from 'frappe-ui'
@ -162,6 +161,11 @@ const rows = computed(() => {
label: dateFormat(deal.modified, dateTooltipFormat), label: dateFormat(deal.modified, dateTooltipFormat),
timeAgo: timeAgo(deal.modified), timeAgo: timeAgo(deal.modified),
} }
} else if (row == 'creation') {
_rows[row] = {
label: dateFormat(deal.creation, dateTooltipFormat),
timeAgo: timeAgo(deal.creation),
}
} }
}) })
return _rows return _rows

View File

@ -74,7 +74,6 @@ import {
Dialog, Dialog,
Button, Button,
Dropdown, Dropdown,
createListResource,
createResource, createResource,
Breadcrumbs, Breadcrumbs,
} from 'frappe-ui' } from 'frappe-ui'
@ -168,6 +167,11 @@ const rows = computed(() => {
label: dateFormat(lead.modified, dateTooltipFormat), label: dateFormat(lead.modified, dateTooltipFormat),
timeAgo: timeAgo(lead.modified), timeAgo: timeAgo(lead.modified),
} }
} else if (row == 'creation') {
_rows[row] = {
label: dateFormat(lead.creation, dateTooltipFormat),
timeAgo: timeAgo(lead.creation),
}
} }
}) })
return _rows return _rows