From 4514e617f5b42079dbd8d9009fcb7df1574ce615 Mon Sep 17 00:00:00 2001 From: Caner Kuru Date: Wed, 14 Jun 2023 08:08:44 -0400 Subject: [PATCH] finailized --- README.md | 4 ++-- src/utils/helpers.js | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/utils/helpers.js diff --git a/README.md b/README.md index 425d0432..70750747 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,13 @@

This hook relies on react, react-native, and @react-native-async-storage/async-storage. Make sure these dependencies are installed in your project.

```bash -npm install react react-native @react-native-async-storage/async-storage +npm install @react-native-async-storage/async-storage ``` or ```bash -yarn add react react-native @react-native-async-storage/async-storage +yarn add @react-native-async-storage/async-storage ``` then diff --git a/src/utils/helpers.js b/src/utils/helpers.js new file mode 100644 index 00000000..789714c3 --- /dev/null +++ b/src/utils/helpers.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.differenceInSeconds = void 0; +const differenceInSeconds = (date1, date2) => { + const diffInMs = Math.abs(date1.getTime() - date2.getTime()); + return diffInMs / 1000; +}; +exports.differenceInSeconds = differenceInSeconds;