Locale utilities for React Native
npm install --save react-native-locale-utils
add the following line to your Podfile:
pod 'LocaleUtils', :path => '../node_modules/react-native-locale-utils'
react-native link react-native-locale-utils
You need rnpm
(npm install -g rnpm
)
rnpm link react-native-locale-utils
import LocaleUtils from 'react-native-locale-utils';
Name | Method | Return | Notes |
---|---|---|---|
24 Hour format | is24HourFormat() |
Boolean | Returns if system time settings uses 12 hour or 24 hour system |
Metric System | usesMetricSystem() |
Boolean | Returns if system locale uses metric system or not |
Device Country Code | deviceCountry() |
String | Returns the two letter country code for the system |