Skip to content

Commit

Permalink
Applied CodeRabitt's suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
Bullrich and coderabbitai[bot] authored Jul 31, 2024
1 parent 32e5dbf commit 3301aef
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lib/components/Status.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
export let name: string;
export let statuses: Status[];
function calculateDifferenceInDays(firstDate: Date, secondDate: Date): number {
const oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
return Math.round(Math.abs((+firstDate - +secondDate) / oneDay)) + 1;
}
const calculateDifferenceInDays = (firstDate: Date, secondDate: Date): number =>
Math.ceil(Math.abs(+firstDate - +secondDate) / (1000 * 60 * 60 * 24));
let message = 'Lacking historical data';
let lastStatus: Status = { status: StatusCode.ERROR, date: new Date() };
Expand Down

0 comments on commit 3301aef

Please # to comment.