don't repeat yourself uwu
This commit is contained in:
parent
e6f2077d9b
commit
f088650669
1 changed files with 5 additions and 3 deletions
|
@ -66,12 +66,14 @@ module Jekyll
|
|||
minutes = " minute" + (time[1] > 1 ? "s" : "") + " "
|
||||
end
|
||||
|
||||
out = ["#{time[0]}#{hours}", "#{time[1]}#{minutes}"]
|
||||
|
||||
if time[1] == 0
|
||||
"#{time[0]}#{hours}"
|
||||
out[0]
|
||||
elsif time[0] == 0
|
||||
"#{time[1]}#{minutes}"
|
||||
out[1]
|
||||
else
|
||||
"#{time[0]}#{hours}#{time[1]}#{minutes}"
|
||||
out.join("")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue