Skip to content

Commit

Permalink
BRS-296-2: showing date in more places (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronpettit authored May 12, 2022
1 parent 7b243f8 commit c000850
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lambda/readPass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,18 @@ exports.handler = async (event, context) => {
token;

const encodedCancellationLink = encodeURI(cancellationLink);
const dateOptions = { day: 'numeric', month: 'long', year: 'numeric' };
let formattedDate = new Date(passData.data[0].date).toLocaleDateString('en-US', dateOptions);
if (passData.data[0].type) {
formattedDate += ' (' + passData.data[0].type + ')'
}

let personalisation = {
registrationNumber: passData.data[0].registrationNumber.toString(),
link: encodedCancellationLink
link: encodedCancellationLink,
date: formattedDate,
parkName: passData.data[0].pk.split('::')[1] || '',
facilityName: passData.data[0].facilityName || ''
};

// Send email
Expand Down
6 changes: 5 additions & 1 deletion lambda/writePass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ exports.handler = async (event, context) => {
'&email=' +
email +
'&park=' +
parkName;
parkName +
'&date=' +
dateselector +
'&type=' +
type;

const encodedCancellationLink = encodeURI(cancellationLink);

Expand Down

0 comments on commit c000850

Please sign in to comment.