See:
http://www.redmine.org/projects/redmine/repository/annotate/tags/2.4.2/app/helpers/timelog_helper.rb#L111