Skip to content

Commit

Permalink
added week fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqedme committed Jan 11, 2024
1 parent d9a4883 commit a4a0aaa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion service/surge-reports/surge-report.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,17 @@ export class SurgeService extends SurgeMultiDatasetPatientlistReport {

determineSurgeReportSourceTables(yearWeek) {
const self = this;
if (yearWeek >= moment().year() + '' + moment().week() - 1) {
var currentYear = moment().year();
var currentWeek = moment().week() - 1;
if (currentWeek < 10) {
currentWeek = '0' + currentWeek;
}

const diffWeek = currentYear + '' + currentWeek;

console.log('yearWeek: ', yearWeek);
console.log('oldYear: ', diffWeek);
if (yearWeek >= diffWeek) {
return (self.params.surgeWeeklyDatasetSource =
'etl.surge_weekly_report_dataset_2022');
} else {
Expand Down

0 comments on commit a4a0aaa

Please sign in to comment.