Skip to content

Commit

Permalink
Fix an issue in dateToEndOfDay (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
anantakrishna committed May 9, 2024
1 parent 7c2017d commit 62b06c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion functions/src/FidelityCheck/FC.functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ import { FidelityCheckRow } from './FidelityCheckRow';
import { FidelityCheckValidator } from './FidelityCheckValidator';
import pMap = require('p-map');

/**
* Returns the end of day if the input date is a start of day.
*/
const dateToEndOfDay = (date: DateTime) =>
date === date.startOf('day') ? date.endOf('day') : date;
// Comparing values of the objects, not objects themselves. See https://moment.github.io/luxon/api-docs/index.html#datetimeequals
+date === +date.startOf('day') ? date.endOf('day') : date;

export const importRecords = functions
.runWith({ timeoutSeconds: 540, memory: '1GB' })
Expand Down

0 comments on commit 62b06c9

Please sign in to comment.