mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-04-14 03:47:59 -04:00
@@ -94,9 +94,9 @@ module PredictPlanting
|
||||
private
|
||||
|
||||
def calculate_percentage_grown
|
||||
return 0 if age_in_days < 0
|
||||
return 0 if age_in_days.to_i < 0
|
||||
|
||||
percent = (age_in_days / expected_lifespan.to_f) * 100
|
||||
percent = (age_in_days.to_f / expected_lifespan.to_f) * 100
|
||||
(percent > 100 ? 100 : percent)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
- if planting.finish_is_predicatable?
|
||||
.card.fact-card
|
||||
%h3 Progress
|
||||
- if planting.age_in_days < 0
|
||||
- if planting.age_in_days.to_i < 0
|
||||
%strong Planned
|
||||
- else
|
||||
%strong #{planting.age_in_days}/#{planting.expected_lifespan}
|
||||
@@ -45,7 +45,7 @@
|
||||
%h3 Growing
|
||||
%strong= seedling_icon
|
||||
%span
|
||||
- if planting.age_in_days < 0
|
||||
- if planting.age_in_days.to_i < 0
|
||||
Planting planned
|
||||
- else
|
||||
Planting is still growing today
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
- elsif @planting.percentage_grown.present?
|
||||
#{@planting.percentage_grown.to_i}%
|
||||
- if @planting.finish_is_predicatable?
|
||||
- if @planting.age_in_days < 0
|
||||
- if @planting.age_in_days.to_i < 0
|
||||
%strong Planned
|
||||
- else
|
||||
%strong #{@planting.age_in_days}/#{@planting.expected_lifespan} days
|
||||
%strong #{@planting.age_in_days.to_i}/#{@planting.expected_lifespan} days
|
||||
|
||||
= render 'timeline', planting: @planting
|
||||
= render 'likes/likes', object: @planting
|
||||
|
||||
Reference in New Issue
Block a user