Adjust `time_tooltip` method to show shorter time format
This commit is contained in:
parent
e8f661f555
commit
f4095c42ec
|
@ -73,8 +73,7 @@ module BootstrapHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def time_tooltip(subject, placement = "bottom")
|
def time_tooltip(subject, placement = "bottom")
|
||||||
tooltip time_ago_in_words(subject.created_at), localize(subject.created_at), placement
|
tooltip time_ago_in_words(subject.created_at, scope: "datetime.distance_in_words.short"), localize(subject.created_at, format: :long), placement
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
@ -42,3 +42,43 @@ en:
|
||||||
days: "days"
|
days: "days"
|
||||||
weeks: "weeks"
|
weeks: "weeks"
|
||||||
months: "months"
|
months: "months"
|
||||||
|
datetime:
|
||||||
|
distance_in_words:
|
||||||
|
short:
|
||||||
|
about_x_hours:
|
||||||
|
one: "1h"
|
||||||
|
other: "%{count}h"
|
||||||
|
about_x_months:
|
||||||
|
one: "1mo"
|
||||||
|
other: "%{count}mo"
|
||||||
|
about_x_years:
|
||||||
|
one: "1y"
|
||||||
|
other: "%{count}y"
|
||||||
|
almost_x_years:
|
||||||
|
one: "1y"
|
||||||
|
other: "%{count}y"
|
||||||
|
half_a_minute: 1m
|
||||||
|
less_than_x_seconds:
|
||||||
|
one: "1s"
|
||||||
|
other: "%{count}s"
|
||||||
|
less_than_x_minutes:
|
||||||
|
one: "1m"
|
||||||
|
other: "%{count}m"
|
||||||
|
over_x_years:
|
||||||
|
one: "1y"
|
||||||
|
other: "%{count}y"
|
||||||
|
x_seconds:
|
||||||
|
one: "1s"
|
||||||
|
other: "%{count}s"
|
||||||
|
x_minutes:
|
||||||
|
one: "1m"
|
||||||
|
other: "%{count}m"
|
||||||
|
x_days:
|
||||||
|
one: "1d"
|
||||||
|
other: "%{count}d"
|
||||||
|
x_months:
|
||||||
|
one: "1mo"
|
||||||
|
other: "%{count}mo"
|
||||||
|
x_years:
|
||||||
|
one: "1y"
|
||||||
|
other: "%{count}y"
|
||||||
|
|
Loading…
Reference in New Issue