Skip to content
Snippets Groups Projects
Commit d7b6e785 authored by Reinder Kraaij's avatar Reinder Kraaij :eye:
Browse files

Add Designated Station

parent f696a8f5
No related branches found
No related tags found
2 merge requests!1213Resolve TMSS-2717 "Refactor details summary + ui tweaks",!1212Resolve TMSS-2717 "Refactor details summary + ui tweaks"
...@@ -24,12 +24,12 @@ export function getGroups(itemGroupKey, startTime, data) { ...@@ -24,12 +24,12 @@ export function getGroups(itemGroupKey, startTime, data) {
if (itemGroupKey =="group") { // then group is the default, date one if (itemGroupKey =="group") { // then group is the default, date one
groups = createDateGroups('', startTime); groups = createDateGroups('', startTime);
} else { } else {
groups = createGroups(data, itemGroupKey, startTime) groups = createGroups(data, itemGroupKey )
} }
return { groups, itemGroupKey } return { groups, itemGroupKey }
} }
export function createGroups(timeLineRows, property, startTime) { export function createGroups(timeLineRows, property ) {
const groups = []; const groups = [];
if (timeLineRows !== undefined && timeLineRows.length>0) { if (timeLineRows !== undefined && timeLineRows.length>0) {
...@@ -43,12 +43,17 @@ export function createGroups(timeLineRows, property, startTime) { ...@@ -43,12 +43,17 @@ export function createGroups(timeLineRows, property, startTime) {
let isSingleStation = false; let isSingleStation = false;
if (splittedElement.length>2) { if (splittedElement.length>2) {
if (splittedElement[2]=="station") isSingleStation = true; if (splittedElement[2]=="station") isSingleStation = true;
} }
const groupDate = moment(datepart) const groupDate = moment(datepart)
const weeknr = groupDate.format("w") const weeknr = groupDate.format("w")
const weekdate = groupDate.format("MMM DD - ddd") const weekdate = groupDate.format("MMM DD - ddd")
const formatedDate = groupDate.format(UIConstants.CALENDAR_GROUP_FORMAT) 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);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment