Skip to content

Commit

Permalink
fix: fix data empty issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Feb 12, 2021
1 parent 63fd43e commit 3a79ff0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/public/js/graph/git/tags-timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ function renderTagsTimeline(data) {
.attr("transform", "translate(0," + height + ")")
.call(d3.axisBottom(x));

let first_year = new Date(selectData[0].date).getFullYear();
let first_year;
if (selectData.length > 0) {
first_year = new Date(selectData[0].date).getFullYear();
} else {
first_year = new Date().getFullYear();
}

let startDate = new Date(first_year, 0, 1);
let y = d3.scaleTime()
.domain([startDate, Date.now()])
Expand Down

0 comments on commit 3a79ff0

Please sign in to comment.