Skip to content

Commit

Permalink
Merge pull request #9 from giakinh0823/giakinh0823
Browse files Browse the repository at this point in the history
fix bug calendar in dashboard
  • Loading branch information
giakinh0823 authored Mar 11, 2022
2 parents b3a0c20 + c460ba1 commit e0fad1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions web/assets/js/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const data = {
labels: labels,
datasets: [{
label: 'Event',
fill: events,
fill: eventCalendars,
backgroundColor: CHART_COLORS.blue,
borderColor: CHART_COLORS.blue,
data: events,
data: eventCalendars,
},
{
label: 'Calendar',
Expand Down
4 changes: 2 additions & 2 deletions web/views/admin/dashboard/dashboard.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@
listCategoryQuantity[${category.id}] = 0;
</c:forEach>
var events = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var eventCalendars = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var calendars = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
<c:forEach items="${events}" var="event">
if (new Date("${event.created_at}").getFullYear() == new Date().getFullYear()) {
events[new Date("${event.created_at}").getMonth()] += 1;
eventCalendars[new Date("${event.created_at}").getMonth()] += 1;
listCategoryQuantity[${event.additional.category.id}] += 1;
}
</c:forEach>
Expand Down

0 comments on commit e0fad1e

Please sign in to comment.