This commit is contained in:
Stella Rouzi 2016-06-15 17:52:59 +03:00
parent 70d0091fbf
commit 2efd1bc92d
4 changed files with 13 additions and 10 deletions

View file

@ -1,4 +1,14 @@
module ApplicationHelper
##
# Gets an EventType object, and returns its length in timestamp format (HH:MM)
# ====Gets
# * +Integer+ -> 30
# ====Returns
# * +String+ -> "00:30"
def length_timestamp(length)
[length / 60, length % 60].map { |t| t.to_s.rjust(2, '0') }.join(':')
end
##
# ====Returns
# * +String+ -> number of registrations / max allowed registrations