Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
react-native-device-info
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
放牛的园子
react-native-device-info
Commits
31ff0194
Commit
31ff0194
authored
Jul 04, 2016
by
Gant Laborde
Committed by
GitHub
Jul 04, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #59 from mehcode/timezone
Add timezone
parents
67c64581
6a4e226a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
RNDeviceInfo.m
RNDeviceInfo/RNDeviceInfo.m
+7
-0
RNDeviceModule.java
...c/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
+1
-0
No files found.
RNDeviceInfo/RNDeviceInfo.m
View file @
31ff0194
...
...
@@ -141,6 +141,12 @@ RCT_EXPORT_MODULE()
return
country
;
}
-
(
NSString
*
)
timezone
{
NSTimeZone
*
currentTimeZone
=
[
NSTimeZone
localTimeZone
];
return
currentTimeZone
.
name
;
}
-
(
NSDictionary
*
)
constantsToExport
{
UIDevice
*
currentDevice
=
[
UIDevice
currentDevice
];
...
...
@@ -162,6 +168,7 @@ RCT_EXPORT_MODULE()
@"buildNumber"
:
[[
NSBundle
mainBundle
]
objectForInfoDictionaryKey
:
@"CFBundleVersion"
],
@"systemManufacturer"
:
@"Apple"
,
@"userAgent"
:
self
.
userAgent
,
@"timezone"
:
self
.
timezone
,
};
}
...
...
android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
View file @
31ff0194
...
...
@@ -91,6 +91,7 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
constants
.
put
(
"systemManufacturer"
,
Build
.
MANUFACTURER
);
constants
.
put
(
"bundleId"
,
packageName
);
constants
.
put
(
"userAgent"
,
System
.
getProperty
(
"http.agent"
));
constants
.
put
(
"timezone"
,
TimeZone
.
getDefault
().
getID
());
return
constants
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment