Gathering detailed insights and metrics for react-native-device-time-format
Gathering detailed insights and metrics for react-native-device-time-format
Gathering detailed insights and metrics for react-native-device-time-format
Gathering detailed insights and metrics for react-native-device-time-format
npm install react-native-device-time-format
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
13 Stars
49 Commits
8 Forks
10 Watching
1 Branches
4 Contributors
Updated on 15 Aug 2023
Java (47.17%)
Objective-C (29.31%)
Ruby (18.32%)
JavaScript (5.2%)
Cumulative downloads
Total Downloads
Last day
24.5%
1,751
Compared to previous day
Last week
-2.8%
7,976
Compared to previous week
Last month
20.4%
35,996
Compared to previous month
Last year
214.6%
357,287
Compared to previous year
No dependencies detected.
On mobile devices users have the option to opt in/out, of the systems locale, in regards to 12/24 hour clock format:
This package exposes this device setting for iOS & Android.
This package was heavily inspired by react-native-device-clock-format, which is "no longer actively maintained", and only supports iOS.
Thank you 🙏
Install with your preferred package manager:
yarn add react-native-device-time-format
or
npm install react-native-device-time-format --save &&
For iOS, install pod:
(cd ios/ && pod install)
For React Native < 0.60
, run:
react-native link react-native-device-time-format
Should the automatic linking fail (in case of folder structure mismatch or various other reasons), please follow the manual installation guide.
Bellow is an example of fetching the hours & minutes string representation from a date, with the device time format (using moment for date/time formatting):
1import { is24HourFormat } from 'react-native-device-time-format' 2import moment from 'moment' 3 4/** 5 * @function getCurrentHourFormat 6 * @param {Date} date Date to format 7 * @return {Promise<string>} formatted string HH:mm / h:mm A, depending on device setting 8 */ 9const getCurrentHourFormat = async (date) => { 10 const is24Hour = await is24HourFormat() 11 return moment(date).format(is24Hour ? 'HH:mm' : 'h:mm A')) 12}
All native modules runs asynchronous, I would suggest updating an internal state in your app when AppState
changes to active.
No vulnerabilities found.
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 3/24 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More