Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
victory-sokolov committed Mar 6, 2024
1 parent 7a17cf8 commit 3ee81de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const secondsInDays = (days: number): number => {
* @returns
*/
export const timeAgo = (date: Date): string => {
const seconds = Math.floor((new Date() - date) / 1000);
const seconds = Math.floor((new Date().valueOf() - date.valueOf()) / 1000);

let interval = Math.floor(seconds / 31536000);
if (interval > 1) {
Expand Down

0 comments on commit 3ee81de

Please sign in to comment.