File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div class =" header-block" >
33 <div class =" time-block" >
4- <p >{{ title }} ({{ countOfSites }} sites) </p >
4+ <p >{{ title }}</p >
55 <p class =" time" >{{ summaryTimeString }}</p >
66 </div >
77 <div class =" sorted-block" >
@@ -30,6 +30,7 @@ const props = defineProps<{
3030 summaryTime: number ;
3131 countOfSites: number ;
3232 firstDay: Date ;
33+ countOfActiveDays: number ;
3334}>();
3435
3536const sortingBySelected = ref <SortingBy >();
@@ -40,7 +41,12 @@ const emit = defineEmits<{
4041
4142const title = computed (() => {
4243 if (props .listType == TypeOfList .Today ) return ' Today' ;
43- if (props .listType == TypeOfList .All ) return ` Aggregate data since ${props .firstDay } ` ;
44+ if (props .listType == TypeOfList .All ) {
45+ let countOfActiveDays = props .countOfActiveDays > 1 ? ` (${props .countOfActiveDays } days) ` : ' ' ;
46+ return ` Aggregate data since ${props .firstDay .toLocaleDateString ()} ${countOfActiveDays } (${
47+ props .countOfSites
48+ } sites) ` ;
49+ }
4450});
4551
4652onMounted (async () => {
Original file line number Diff line number Diff line change 88 :summaryTime =" summaryTime"
99 :countOfSites =" countOfSites"
1010 :firstDay =" firstDay"
11+ :countOfActiveDays =" countOfActiveDays"
1112 @sortingBy =" sorting"
1213 />
1314
@@ -49,6 +50,8 @@ const timeForChart = ref<number[]>();
4950const sitesForChart = ref <string []>();
5051
5152const summaryTime = ref <number >();
53+ const firstDay = ref <Date >();
54+ const countOfActiveDays = ref <number >();
5255
5356const countOfSites = computed (() => (tabs .value != undefined ? tabs .value .length : 0 ));
5457
@@ -57,6 +60,8 @@ async function loadList(sortingBy: SortingBy) {
5760 if (props .type == TypeOfList .Today ) tabSummary = await useTodayTabListSummary (sortingBy );
5861 if (props .type == TypeOfList .All ) {
5962 tabSummary = await useAllTabListSummary (sortingBy );
63+ firstDay .value = tabSummary .firstDay ;
64+ countOfActiveDays .value = tabSummary .activeDaysTotal ;
6065 dataForOvarallStats .value = tabSummary ;
6166 }
6267
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export async function useAllTabListSummary(sortingBy: SortingBy): Promise<Overal
1111 let tabs : Tab [ ] = [ ] ;
1212
1313 const summaryTimeListForToday = unSortedTabs . map ( function ( tab ) {
14- return tab . days . find ( day => day . date === todayLocalDate ( ) ) ! . summary ;
14+ return tab . days . find ( day => day . date === todayLocalDate ( ) ) ? .summary ;
1515 } ) ;
1616
1717 const todaySummaryTime =
You can’t perform that action at this time.
0 commit comments