Giter VIP home page Giter VIP logo

hh-mm-ss's People

Contributors

davidwilde avatar goldob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hh-mm-ss's Issues

Add option to omit leading zeros

The following features are requested, along with test cases to support them:

  • Add option not to add leading zeros in fromMs(), e.g. return 2:30 instead of 02:30 with input 150000
  • Make toMs() accept input without leading zeros

failed to minify index.js:4

I am working on a project and when I try to package it with reactjs and webpack it spits out an error.
"Creating an optimized production build...Failed to compile.
Failed to minify the code from this file:
./node_modules/hh-mm-ss/index.js:4
Read more here: http://bit.ly/2tRViJ9 "

hh:mm support

It would be nice to support hh:mm format, I have a timing app where I don't want to show seconds ticking over as it's distracting

TimeFormat.fromS is not a function

When using this

import * as TimeFormat from 'hh-mm-ss';

console.log(TimeFormat.fromS(process.uptime(), 'hh:mm:ss'))

I get

(node:8264) UnhandledPromiseRejectionWarning: TypeError: TimeFormat.fromS is not a function
    at Object.run (file:///C:/Users/zz/Documents/GitHub/nottriz/TwitchCMCB-ALPHA/commands/debug.js:11:110)
    at Module.onMessage (file:///C:/Users/zz/Documents/GitHub/nottriz/TwitchCMCB-ALPHA/events/onMessage.js:40:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8264) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8264) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Error: SyntaxError: Unexpected token =

Just went to use this for the first time and hit this error:

REDACTED/node_modules/hh-mm-ss/index.js:23
function fromMs (ms, format = 'mm:ss') {
                            ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (REDACTED/workers/app.js:9:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

Format not working

I have the following:

export const formatSecondsToStopWatch = (seconds, displayFormat = 'hh:mm:ss') => {
  console.log('input', seconds)
  console.log('displayFormat', displayFormat)
  let test = timeFormat.fromS(seconds, displayFormat)
  console.log('output', test)
  return test
}

formatSecondsToStopWatch(2, 'hh:mm')
formatSecondsToStopWatch(2)

which outputs

input 2
stopwatch.js:59 displayFormat hh:mm
stopwatch.js:61 output 00:00:02
stopwatch.js:58 input 2
stopwatch.js:59 displayFormat hh:mm:ss
stopwatch.js:61 output 00:00:02

When I expecting the first output to be 00:00

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.