Socket
Socket
Sign inDemoInstall

clock-format-utility

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clock-format-utility

Utility that can detect clock format (12/24 hour) and can set clock format for moment


Version published
Weekly downloads
9
increased by800%
Maintainers
1
Weekly downloads
 
Created
Source

clock-format-utility

Codeship Status for robertherber/clock-format-utility

This is a tiny library used to set 12/24 hour clock formatting. The main use-case is to support non-standard language/localization combinations - specifically in moment.

It exposes the following methods; two detection methods:

  • detectDeviceClockFormat
    • by parsing date.toLocaleString(detectedDeviceLocale)
  • detectDeviceLocale
    • using react-native-device-info or (if not available) navigator.language

And two specifically aimed at configuring moment:

  • setMomentLocaleClockFormat
    • overrides current moment locale clock format with detected device clock format
  • setMomentLocale
    • sets moment.locale to the detected device locale

Please feel free to submit pull-requests for other libraries (detectDeviceLocale could benefit from supporting more libraries than react-native-device-info, and setters for date-fns would be very welcome)

Keywords

FAQs

Package last updated on 16 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc