From 39135bc97051366faaee44c93a5933281b85fdd2 Mon Sep 17 00:00:00 2001 From: DicoTiar Date: Wed, 7 Jul 2021 00:17:50 +0100 Subject: [PATCH] #10 request date updated based on the UTC time for airflow job --- covid_tmp/src/plugins/getToday.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/covid_tmp/src/plugins/getToday.js b/covid_tmp/src/plugins/getToday.js index 1cd0d33..6c7fcf2 100644 --- a/covid_tmp/src/plugins/getToday.js +++ b/covid_tmp/src/plugins/getToday.js @@ -1,7 +1,10 @@ function getTargetDate(delta) { var curday = function(sp){ var today = new Date(); - if (today.getUTCHours() < 10) { + if (today.getUTCHours() < 1) { + today.setDate(today.getDate() - delta - 2) + } + else if (today.getUTCHours() < 10) { today.setDate(today.getDate() - delta - 1) } else { today.setDate(today.getDate() - delta)