Skip to content

Commit

Permalink
feat(cb2-16540): formatting dates in query
Browse files Browse the repository at this point in the history
  • Loading branch information
m-coslett committed Feb 26, 2025
1 parent 51b4a91 commit acfef01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/queries/antsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ SELECT
make,
model,
wheelplan,
test_date,
DATE_FORMAT(test_date,'%d/%m/%Y') test_date,
weight_before_test,
weight_after_test,
DOE_reference,
tech_record_date
DATE_FORMAT(tech_record_date,'%d/%m/%Y') tech_record_date
FROM vw_dvla_ants
WHERE test_date >= STR_TO_DATE(?, '%d/%m/%Y %T')
ORDER BY test_date ASC;`;
2 changes: 1 addition & 1 deletion src/infrastructure/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ router.get('/ants', (_req, res) => {
const processedResult = result.map((entry) => processAntsFeedData(entry));
const antsFeedProcessedData: string = processedResult
.map(
(entry) => `${entry.vrm_trm},${entry.make},${entry.model}, ${entry.wheelplan},${moment(entry.test_date).format('DD-MM-YYYY')},${entry.weight_before_test},${entry.weight_after_test},${entry.DOE_reference},${moment(entry.tech_record_date).format('DD-MM-YYYY')}`,
(entry) => `${entry.vrm_trm},${entry.make},${entry.model}, ${entry.wheelplan},${entry.test_date},${entry.weight_before_test},${entry.weight_after_test},${entry.DOE_reference},${entry.tech_record_date}`,
)
.join('\n');
logger.debug(`\nData captured for file generation: ${antsFeedProcessedData} \n\n`);
Expand Down

0 comments on commit acfef01

Please sign in to comment.