diff --git a/static/resources/predtimechart.js b/static/resources/predtimechart.js index ae5b60b..64ad7a9 100644 --- a/static/resources/predtimechart.js +++ b/static/resources/predtimechart.js @@ -19,24 +19,11 @@ function _fetchData(isForecast, targetKey, taskIDs, referenceDate) { const taskIDsValsStr = replace_chars(taskIDsValsSorted.join(' ')); let target_path; - // Get the reference date for today and use it to find - // the correct targets file - var now = new Date(); - const day = now.getDay(); - var days_to_saturday = 6 - day; - if (days_to_saturday < 0) { - days_to_saturday = days_to_saturday + 7; - } - now.setDate(now.getDate() + days_to_saturday); - const tagetDate = now.toISOString().split("T")[0]; - - const slug = `${targetKeyStr}_${taskIDsValsStr}`; - const forecast_file_name = `${slug}_${referenceDate}.json`; - const target_file_name = `${slug}_${tagetDate}.json`; + const file_name = `${targetKeyStr}_${taskIDsValsStr}_${referenceDate}.json`; if (isForecast) { - target_path = `${root}/forecasts/${forecast_file_name}`; + target_path = `${root}/forecasts/${file_name}`; } else { - target_path = `${root}/targets/${target_file_name}`; + target_path = `${root}/targets/${file_name}`; } return fetch(target_path); // Pwomise? }