Jump to content

Duration Calculator — Add and subtract durations of time

Recommended Posts

I'd love to see the source of this.  The workflow just has an executable.  Am curious as to how you extended the built-in calculator.


I'll probably post the source code on GitHub at some point. Here's a quick look in the meantime: http://cl.ly/code/3a402k0D1s2v


By the way, I'm not actually extending the codebase for Alfred's calculator. The workflow feels like an extension of the calculator because it is triggered by the same characters that trigger the normal calculator (i.e. 0-9 and +-). These keywords act as a bridge to the binary, which returns results very similar to Alfred's normal calculator. It's also very fast, mainly because it's written in C.

Link to comment
  • 5 years later...
  • 2 months later...

For your latest code. I had to change from const char sep = ':'; to const char sep[2] = ":"; to get it to work. Compiled, ran, happy. Test for me was: "03:50+ 10:40" which di not result in 14:30, but in something with a 5 in the end - 13:45 I think it was. The first value did not get parsed to 3h 50min, but to 3h 5min. The latter worked!? 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...