Skip to content

Commit 162a254

Browse files
committed
[frontend] add year to ticks that span across multiple years
1 parent 065eef7 commit 162a254

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

frontend/express/public/javascripts/countly/countly.common.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -1893,10 +1893,18 @@
18931893
}
18941894
}
18951895
else{
1896+
var startYear = start.year();
1897+
var endYear = moment().year();
18961898
for (var i = 0; i < days; i++) {
18971899
start.add(1, 'days');
1898-
ticks.push([i, countlyCommon.formatDate(start, "D MMM")]);
1899-
tickTexts[i] = countlyCommon.formatDate(start, "D MMM, dddd");
1900+
if(startYear < endYear){
1901+
ticks.push([i, countlyCommon.formatDate(start, "D MMM YYYY")]);
1902+
tickTexts[i] = countlyCommon.formatDate(start, "D MMM YYYY, dddd");
1903+
}
1904+
else{
1905+
ticks.push([i, countlyCommon.formatDate(start, "D MMM")]);
1906+
tickTexts[i] = countlyCommon.formatDate(start, "D MMM, dddd");
1907+
}
19001908
}
19011909
}
19021910
}

0 commit comments

Comments
 (0)