react-native-timezone 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +35 -27
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,31 +1,39 @@
1
- # react-native-timezone
1
+ # React Native Timezone
2
+ [![Maintainability](https://api.codeclimate.com/v1/badges/3713253a365fe6a55615/maintainability)](https://codeclimate.com/github/samitha9125/react-native-timezone/maintainability)
2
3
 
3
4
  A Simple react native module to get Timezone of the Android/iOS device.
4
5
 
5
- ## Installation
6
-
7
- ```sh
8
- npm install react-native-timezone
9
- ```
10
-
11
- ## Usage
12
-
13
- ```js
14
- import { multiply } from 'react-native-timezone';
15
-
16
- // ...
17
-
18
- const result = await multiply(3, 7);
6
+ # Motivation
7
+ For a project of mine, I had to acquire the current selected timezone of the user. But unfortunately I could not find any react native package or react native in-build function which facilitates this. Thus I created a small library.
8
+
9
+ # Compatibility
10
+ Timezone version 2.0.0 only support React Native version 0.62.3 and above due to React Native Regular Expression Denial of Service (ReDoS) vulnerability.
11
+
12
+ | React native version | Tested | Result |
13
+ |----------------------|--------|--------|
14
+ | 0.62.3 + | ✅ | ✅ |
15
+ | 0.62.5 + | ✅ | ✅ |
16
+ | 0.71.3 + | ✅ | ✅ |
17
+
18
+ # Installation
19
+
20
+ `npm i react-native-timezone`
21
+
22
+ ## iOS
23
+
24
+ Do `cd ios/ && pod install`.
25
+
26
+ # Usage
27
+ ```javascript
28
+ import TimeZone from 'react-native-timezone';
29
+
30
+ getTimeZone = async() => {
31
+ const timeZone = await TimeZone.getTimeZone().then(zone => zone);
32
+ console.log({ timeZone });
33
+ }
19
34
  ```
20
-
21
- ## Contributing
22
-
23
- See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
24
-
25
- ## License
26
-
27
- MIT
28
-
29
- ---
30
-
31
- Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
35
+ Check out the [example]("https://github.com/samitha9125/react-native-timezone/tree/master/example") folder.
36
+ # API
37
+ | API | Description |
38
+ |-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
39
+ | getTimeZone | Android : Returns timezone ID using java.util.TimeZone.getID()<br>iOS : This always reflects the current system time zone using localTimeZone of NSTimeZone |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-timezone",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "A Simple react native module to get Timezone of the Android/iOS device.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -81,7 +81,7 @@
81
81
  "react-native": "*"
82
82
  },
83
83
  "engines": {
84
- "node": ">= 16.0.0"
84
+ "node": ">= 14.0.0"
85
85
  },
86
86
  "packageManager": "^yarn@1.22.15",
87
87
  "jest": {