Catalog npm
PACKAGE EXPLORERView in registry

24hto12hformat

npm

Converts from 24-hour hh:mm to 12-hour hh:mm +merdian

12 hour24 hourtimetime formatter
Versions collected6
Direct dependencies2From release 0.0.6
Last observed20 Oct, 19:03 UTC

README

Current package documentation

24hto12hformat

Converts from 24-hour hh:mm to 12-hour hh:mm +merdian or hh:mm:ss +merdian format.

Usage

Install:

yarn add 24hto12hformat
# or
npm install 24hto12hformat --save

In your code:

import timeFormatter from '24hto12hformat';

timeFormatter('13:30'); // => 1:30 pm
// same as timeFormatter('13:30', false);
// but
timeFormatter('13:30', true); // => 1:30 PM

// works fine
timeFormatter('15:33:29 GMT+020'); // => 3:33 pm

// to add seconds:
timeFormatter('13:30', true, true); // => 1:30:00 PM
timeFormatter('13:30:13', true, true); // => 1:30:13 PM

Contract

/**
 *
 * @param {string} time
 * @param {boolean} uppercase
 * @param {boolean} includeSeconds
 * @return {string}
 */

If the the supplied time argument is not a string, or it does not start in the hh:mm format, then the module will throw an exception in the form of a string.

Other Notes

Fun fact: the original name of this package (24h-to-12h-format) could not be published to NPM due to their system considering it a spam name. :)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 6

Collected releases
VersionPublishedDirect dependenciesOpen version
0.0.6Registry latest23 Jul 20182
0.0.511 May 20182
0.0.411 May 20182
0.0.311 May 20182
0.0.28 Apr 20182
0.0.13 Apr 20182

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
filipdanic/24h-to-12h-format

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:03 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:15b8bc9068840df4450df4a014b27be286571569af18589615588da1d3fb315c