BUG FIXED: Dates as string

This commit is contained in:
Luis Fernando Molina committed 2019-04-30 19:40:29 +02:00
1 parent 5bad7f7be1
commit 5feb1b693c
2 files changed
+20 -31

No files matched your search

+13 -16
View File
@@ -78,8 +78,8 @@ function newDailyFiles () {
case GLOBAL.DEFAULT_OK_RESPONSE.result: {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> Received OK Response.') }
beginDateRange = new Date(pFile.begin)
endDateRange = new Date(pFile.end)
beginDateRange = pFile.begin
endDateRange = pFile.end
break
}
@@ -141,23 +141,20 @@ function newDailyFiles () {
switch (err.result) {
case GLOBAL.DEFAULT_OK_RESPONSE.result: {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received OK Response.') }
break
}
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received OK Response.') }
break
}
case GLOBAL.DEFAULT_FAIL_RESPONSE.result: {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received FAIL Response.') }
callBackWhenFileReceived(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
}
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received FAIL Response.') }
callBackWhenFileReceived(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
}
default: {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received Unexpected Response.') }
callBackWhenFileReceived(err)
return
}
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received Unexpected Response.') }
callBackWhenFileReceived(err)
return
}
}
fileCursors.set(periodTime, fileCursor)
+7 -15
View File
@@ -66,7 +66,7 @@ function newFileCursor () {
bot = pBot
thisSet = pSet
periodName = pPeriodName
cursorDate = pCursorDate
cursorDate = removeTime(pCursorDate)
timePeriod = pTimePeriod
beginDateRange = pBeginDateRange
endDateRange = pEndDateRange
@@ -194,7 +194,7 @@ function newFileCursor () {
*/
cursorDate = pDatetime // Adjust the cursor date to the one received.
cursorDate = removeTime(pDatetime) // Adjust the cursor date to the one received.
let positionA
@@ -445,29 +445,21 @@ function newFileCursor () {
}
}
let compareTargetDate = new Date(targetDate.toDateString())
let compareTargetDate = new Date(targetDate.valueOf())
if (beginDateRange !== undefined) {
let compareBeginDate = new Date(beginDateRange.toDateString())
if (compareTargetDate.valueOf() < compareBeginDate.valueOf()) {
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate < compareBeginDate -> Not loading the file for this date.') }
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate < compareBeginDate -> compareTargetDate = ' + compareTargetDate) }
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate < compareBeginDate -> compareBeginDate = ' + compareBeginDate) }
let compareBeginDate = beginDateRange
if (compareTargetDate.valueOf() < compareBeginDate) {
controlLoop()
return
}
}
if (endDateRange !== undefined) {
let compareEndDate = new Date(endDateRange.toDateString())
if (compareTargetDate.valueOf() > compareEndDate.valueOf()) {
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate > compareEndDate -> Not loading the file for this date.') }
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate > compareEndDate -> compareTargetDate = ' + compareTargetDate) }
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate > compareEndDate -> compareEndDate = ' + compareEndDate) }
let compareEndDate = endDateRange
if (compareTargetDate.valueOf() > compareEndDate) {
controlLoop()
return
}