Skip to content

Commit

Permalink
fix: code issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mjatin-dev committed Mar 4, 2022
1 parent fc882ec commit 39badec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions admin-ui/plugins/admin/components/MAU/MauGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function MauGraph({ statData, permissions, clients, loading, dispatch }) {
let stat = input
if (stat && stat.length >= 1) {
let flattendStat = stat.map((entry) => entry['month'])
let aRange = generateDateRange(moment(startDate), moment(endDate))
let aRange = generateDateRange(startDate, endDate)
for (const ele of aRange) {
const currentMonth = getYearMonth(new Date(ele))
if (flattendStat.indexOf(parseInt(currentMonth, 10)) === -1) {
Expand Down Expand Up @@ -95,7 +95,9 @@ function MauGraph({ statData, permissions, clients, loading, dispatch }) {
}
}

function generateDateRange(start, end) {
function generateDateRange(startDate, endDate) {
const start = moment(startDate)
const end = moment(endDate)
var result = []

while (end > start || start.format('M') === end.format('M')) {
Expand Down

0 comments on commit 39badec

Please sign in to comment.