henrypoydar / chronic_duration

A simple Ruby natural language parser for elapsed time
MIT License
351 stars 68 forks source link

implemented hide_seconds option for ChronicDuration#output #9

Closed arturopie closed 12 years ago

arturopie commented 13 years ago

Hi,

I think would be a great idea to have the option of hiding the seconds of the output. I implemented this and wrote test for that. Now you can say:

ChronicDuration.output(4 * 3600 + 60 + 1, :hide_seconds => true) => "4 hrs 1 min"

Thanks,

Arturo

rzmz commented 12 years ago

Hi, otherwise great feature, I'm going to use your fork for now but don't you want to add the skipped seconds to the overall result when seconds part is lets say > 30. Ex: 3h 33m 56.0s would become 3h 34m when calling output method and :hide_seconds => true

arturopie commented 12 years ago

No, don't use my changes. My refactoring introduced a bug.