From 4580d3ca9bcf9745084ce2e0852dff6a7f5001c9 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 2 Aug 2023 18:05:44 +0530 Subject: [PATCH] fix: added created/modified time stamp also added scroll to details and activities section --- frontend/src/pages/Lead.vue | 244 +++++++++++++++++++----------------- frontend/src/utils.js | 10 ++ 2 files changed, 142 insertions(+), 112 deletions(-) create mode 100644 frontend/src/utils.js diff --git a/frontend/src/pages/Lead.vue b/frontend/src/pages/Lead.vue index 65218285..c5952efb 100644 --- a/frontend/src/pages/Lead.vue +++ b/frontend/src/pages/Lead.vue @@ -67,122 +67,141 @@ :style="{ left: `${indicatorLeftValue}px` }" /> - - + + -
-
- -
- {{ section.label }} - -
- -
-
-
{{ field.label }}
-
- - - - - - - - - - - - +
+
+
+ +
+ {{ section.label }} + +
+ +
+
+
{{ field.label }}
+
+ + + + + + + + + + + + +
-
- - + + +
+
+
+ Created + + {{ timeAgo(lead.doc.creation) }} + +  ·  + Updated + + {{ timeAgo(lead.doc.modified) }} +
@@ -209,6 +228,7 @@ import { } from 'frappe-ui' import { TransitionPresets, useTransition } from '@vueuse/core' import { usersStore } from '@/stores/users' +import { dateFormat, timeAgo } from '@/utils' import { ref, computed, h } from 'vue' import Breadcrumbs from '@/components/Breadcrumbs.vue' diff --git a/frontend/src/utils.js b/frontend/src/utils.js new file mode 100644 index 00000000..b9cc8688 --- /dev/null +++ b/frontend/src/utils.js @@ -0,0 +1,10 @@ +import { useDateFormat, useTimeAgo } from '@vueuse/core' + +export function dateFormat(date, format) { + const _format = format || 'DD-MM-YYYY HH:mm:ss' + return useDateFormat(date, _format).value +} + +export function timeAgo(date) { + return useTimeAgo(date).value +}