diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/business/timelinegroupingbusiness.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/business/timelinegroupingbusiness.js index 765af10d0bb3601e511d8793de479dc0e44d4fb3..00bc3e771ba48cc243bc83fc7dbe18b0f545e61b 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/business/timelinegroupingbusiness.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/business/timelinegroupingbusiness.js @@ -24,12 +24,12 @@ export function getGroups(itemGroupKey, startTime, data) { if (itemGroupKey =="group") { // then group is the default, date one groups = createDateGroups('', startTime); } else { - groups = createGroups(data, itemGroupKey, startTime) + groups = createGroups(data, itemGroupKey ) } return { groups, itemGroupKey } } -export function createGroups(timeLineRows, property, startTime) { +export function createGroups(timeLineRows, property ) { const groups = []; if (timeLineRows !== undefined && timeLineRows.length>0) { @@ -43,12 +43,17 @@ export function createGroups(timeLineRows, property, startTime) { let isSingleStation = false; if (splittedElement.length>2) { if (splittedElement[2]=="station") isSingleStation = true; + } const groupDate = moment(datepart) const weeknr = groupDate.format("w") const weekdate = groupDate.format("MMM DD - ddd") const formatedDate = groupDate.format(UIConstants.CALENDAR_GROUP_FORMAT) - groups.push({ id: element, title:splittedElement[0], date: groupDate, formatedDate: formatedDate, weeknr: weeknr, weekdate: weekdate, isSingleStation:isSingleStation }); + const newgroup = { id: element, title:splittedElement[0], date: groupDate, formatedDate: formatedDate, weeknr: weeknr, weekdate: weekdate, isSingleStation:isSingleStation }; + if (isSingleStation) { + newgroup.designatedStation=splittedElement[0]; + } + groups.push(newgroup); } }