Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BRS:224 #252

Merged
merged 3 commits into from
Oct 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion lambda/export-variance/invokable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function formatRecords(records) {
}
const date = record.pk.split('::')[2];
record['year'] = date.slice(0, 4);
record['month'] = date.slice(4);
record['month'] = convertMonth(parseInt(date.slice(4)));
}
}

Expand Down Expand Up @@ -282,4 +282,50 @@ async function uploadToS3(csvData) {
}
logger.debug("Uploaded to S3");

}

function convertMonth(monthNumber){
let monthName;

switch (monthNumber) {
case 1:
monthName = 'January';
break;
case 2:
monthName = 'February';
break;
case 3:
monthName = 'March';
break;
case 4:
monthName = 'April';
break;
case 5:
monthName = 'May';
break;
case 6:
monthName = 'June';
break;
case 7:
monthName = 'July';
break;
case 8:
monthName = 'August';
break;
case 9:
monthName = 'September';
break;
case 10:
monthName = 'October';
break;
case 11:
monthName = 'November';
break;
case 12:
monthName = 'December';
break;
default:
monthName = `Invalid month: ${monthNumber}`;
}
return monthName
Christopher-walsh22 marked this conversation as resolved.
Show resolved Hide resolved
}