Skip to content

Commit

Permalink
chore: remove unnecessary converison from nHoursAgo()
Browse files Browse the repository at this point in the history
  • Loading branch information
jiftechnify committed May 14, 2023
1 parent 726dc23 commit 666b853
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pnpm add nostr-fetch
import { eventKind, NostrFetcher } from "nostr-fetch";

const nHoursAgo = (hrs: number): number =>
Math.floor(new Date(Date.now() - hrs * 60 * 60 * 1000).getTime() / 1000);
Math.floor((Date.now() - hrs * 60 * 60 * 1000) / 1000);

const fetcher = NostrFetcher.init();
const relayUrls = [/* relay URLs */];
Expand Down
2 changes: 1 addition & 1 deletion packages/@nostr-fetch/examples/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const nHoursAgo = (hrs: number): number =>
Math.floor(new Date(Date.now() - hrs * 60 * 60 * 1000).getTime() / 1000);
Math.floor((Date.now() - hrs * 60 * 60 * 1000) / 1000);

export const defaultRelays = [
"wss://relay-jp.nostr.wirednet.jp",
Expand Down

0 comments on commit 666b853

Please sign in to comment.