Current collected state Current
Observed since 20 Oct, 19:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
24hto12hformat
Converts from 24-hour hh:mm to 12-hour hh:mm +merdian
Converts from 24-hour hh:mm to 12-hour hh:mm +merdian or hh:mm:ss +merdian format.
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
/**
*
* @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.
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. :)
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
babel-cliEnvironment{
"local_name": "babel-cli",
"alias": false,
"peer_metadata": null
} | ^6.26.0 | development |
babel-preset-envEnvironment{
"local_name": "babel-preset-env",
"alias": false,
"peer_metadata": null
} | ^1.6.1 | development |
Source distribution
{
"integrity": "sha512-BPZQ4lWb2U51ANrAArSa5AbuJ6nFK1mfggoylWk2AOwfqByPrHylEy0N/QaWdQP0jFWi1lVdap6HGjQMv1N0VQ==",
"shasum": "a35ee722a588ea6017d540370de591699ee349bf",
"tarball": "https://registry.npmjs.org/24hto12hformat/-/24hto12hformat-0.0.3.tgz",
"fileCount": 8,
"unpackedSize": 66527,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9ZkTCRA9TVsSAnZWagAA4wwP/i0nAfCXLitznyKWeviV\npZQWdjfayLGbG+rBPUuXy+hUrh542mHJTRpGJwn9jQvZHbYRPlBNNUdd5sop\nTScbKs7aJzwxz/R0tksZFFvTMhyeKK0w+2tpC0fQnPgJUGyZ7gcwF5Q/TPJE\nP+BpUIk2K4AvNVq9ISU9Xzg5TptRtL8t84ElNwqDc+LtQ016BI+XlhED1lDa\nUfXnyJSX6+nZNsMq0tYMOQV/+pDSjdEpBxSCPJlP/JfUofDvwUtdRDtlOjm3\n+BiqWnjAHcdGWtTXKESelsMZvPVJd3PO5Drq9at5SYWyVwwhj7hTCZ2Q7x6m\nUAhQBcFXkfGWvIN101mzexw8x1XI/fJAfV4XwoungyAGekyUThKNdmyImNk2\ndzJVMYI0O5Fz6UMcJHlJIZ3LPMVsdkzKVLvDq7b0EXuArkJTbqxl3EMoTzJe\nTIqyPNT6aD7RDwND53PJPnmSMoIY1d+2Por0yXow12B+Ut5iOCVjPv4QvQIg\n2Nx0ejyAbajbVqsoTNODtgXW6MVTJIQlPHUd5/YafiUpN8/4goQcv61M0FJj\nVLFLj68zfqrnJ0croCoMPpC7oxkaJdljtJdpXBug3LSIBIXp8EoXNbz3zwjr\n4t+KF+6+ZaWmzjFFUr2KjaJl8e33mmvpOslv4al5Z1IZhV2GArOiJybVd0c4\njmyB\r\n=kmpD\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIHiyc5+r4AjOXPII3YfRozFrFru9UMDb5RHdDdwL3961AiEA72kwTf/wi6vf90RjYPqrFWwuUtQ0cJntZ+KaNvE04Y4="
}
]
}Shared repository data · GitHub
Observed since 20 Oct, 19:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:7e3f377cad7afc193f19c77d0f1c8fc016113efdbe889c683237a3be75a8cd53