Skip to content
Snippets Groups Projects
Commit 29f633af authored by Yoan VALLET's avatar Yoan VALLET
Browse files

review createDayDatafiles.js

parent f3c8e63d
Branches
Tags
No related merge requests found
......@@ -14,14 +14,13 @@ function getRandomInt(min, max) {
return result
}
const generateData = (startingdate, endingDate, min, max) => {
const generateData = (_startingdate, _endingDate, min, max) => {
let parsingDate = DateTime.local(
startingdate.year,
startingdate.month,
startingdate.day
_startingdate.year,
_startingdate.month,
_startingdate.day
)
let lastDay = parsingDate.day
const dayDumpArray = []
let lastMonth = parsingDate.month
......@@ -33,7 +32,7 @@ const generateData = (startingdate, endingDate, min, max) => {
let monthlyLoad = 0
let yearlyLoad = 0
while (parsingDate <= endingDate) {
while (parsingDate <= _endingDate) {
const load = getRandomInt(min, max)
monthlyLoad += load
......@@ -73,7 +72,6 @@ const generateData = (startingdate, endingDate, min, max) => {
yearlyLoad = 0
lastYear = parsingDate.year
}
lastDay = parsingDate.day
parsingDate = parsingDate.plus({ days: 1 })
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment