Skip to content

Instantly share code, notes, and snippets.

@kognate
Created October 22, 2009 15:31
Show Gist options
  • Save kognate/216015 to your computer and use it in GitHub Desktop.
Save kognate/216015 to your computer and use it in GitHub Desktop.
module Temporal
def to_human_minutes(minutes)
_h = minutes % 60
if _h > 0
sprintf("%d hours and %s",_h,ActionView::Helpers::TextHelper.pluralize((minutes / 60).to_i,"minute"))
else
ActionView::Helpers::TextHelper.pluralize((minutes / 60).to_i,"minute")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment