GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - CompactJS/parse-time: Small hour/time parser & stringifier

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
.prettierrc.js
.prettierrc.js
 
 
.releaserc.json
.releaserc.json
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

@compactjs/parse-time

Tiny hour parser & stringifier

Version License: MIT

· Homepage · Report Bug / Request Feature ·

Table of Contents

  • Installation
  • Usage
  • Test
  • Contact
  • Contributing
  • License

Install

NPM:

npm install @compactjs/parse-time

CDN:

<script src="https://unpkg.com/@compactjs/parse-time/dist/index.umd.js"></script>

Usage

As module:

import { parse, stringify } from '@compactjs/parse-time';

Example:

// parse a time string to a number
parse('13:30'); // => 13.5
parse('13:19:48'); // => 13.33

// stringify a number to a time string
stringify(13.33); // => 13:19:48

// formating options:
stringify(13.33, 'hh'); // => 13
stringify(13.33, 'hh:mm'); // => 13:19
stringify(13.33, 'hh:mm:ss'); // => 13:19:48

// it accepts numbers higher than 24
stringify(34.5); // => 34:30:00

// to limit to a range between 0 and 24 (or 0-12),
// I recommend to use https://github.com/CompactJS/limit
stringify(limit(34.5, 24)); // => 10:30:00

Run tests

npm run test

Contact

👤 Timo Bechtel [email protected]

  • Website: https://timobechtel.com
  • Twitter: @TimoBechtel
  • GitHub: @TimoBechtel

🤝 Contributing

Contributions, issues and feature requests are welcome!

  1. Check issues
  2. Fork the Project
  3. Create your Feature Branch (git checkout -b feat/AmazingFeature)
  4. Test your changes npm run test
  5. Commit your Changes (git commit -m 'feat: add amazingFeature')
  6. Push to the Branch (git push origin feat/AmazingFeature)
  7. Open a Pull Request

Commit messages

This project uses semantic-release for automated release versions. So commits in this project follow the Conventional Commits guidelines. I recommend using commitizen for automated commit messages.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Distributed under the MIT License.


This README was generated with ❤️ by readme-md-generator

About

Small hour/time parser & stringifier

Topics

hourjavascriptparserstringifiertime

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.