mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed label spacing in Date->TimeDiff()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@68762 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
76f4af842e
commit
5a31a74b6f
@ -126,27 +126,27 @@ class Date extends DBField {
|
||||
|
||||
if($ago < 60) {
|
||||
$span = $ago;
|
||||
return ($span != 1) ? "{$span}"._t("Date.SECS", " secs") : "{$span}"._t("Date.SEC", " sec");
|
||||
return ($span != 1) ? "{$span} "._t("Date.SECS", " secs") : "{$span} "._t("Date.SEC", " sec");
|
||||
}
|
||||
if($ago < 3600) {
|
||||
$span = round($ago/60);
|
||||
return ($span != 1) ? "{$span}"._t("Date.MINS", " mins") : "{$span}"._t("Date.MIN", " min");
|
||||
return ($span != 1) ? "{$span} "._t("Date.MINS", " mins") : "{$span} "._t("Date.MIN", " min");
|
||||
}
|
||||
if($ago < 86400) {
|
||||
$span = round($ago/3600);
|
||||
return ($span != 1) ? "{$span}"._t("Date.HOURS", " hours") : "{$span}"._t("Date.HOUR", " hour");
|
||||
return ($span != 1) ? "{$span} "._t("Date.HOURS", " hours") : "{$span} "._t("Date.HOUR", " hour");
|
||||
}
|
||||
if($ago < 86400*30) {
|
||||
$span = round($ago/86400);
|
||||
return ($span != 1) ? "{$span}"._t("Date.DAYS", " days") : "{$span}"._t("Date.DAY", " day");
|
||||
return ($span != 1) ? "{$span} "._t("Date.DAYS", " days") : "{$span} "._t("Date.DAY", " day");
|
||||
}
|
||||
if($ago < 86400*365) {
|
||||
$span = round($ago/86400/30);
|
||||
return ($span != 1) ? "{$span}"._t("Date.MONTHS", " months") : "{$span}"._t("Date.MONTH", " month");
|
||||
return ($span != 1) ? "{$span} "._t("Date.MONTHS", " months") : "{$span} "._t("Date.MONTH", " month");
|
||||
}
|
||||
if($ago > 86400*365) {
|
||||
$span = round($ago/86400/365);
|
||||
return ($span != 1) ? "{$span}"._t("Date.YEARS", " years") : "{$span}"._t("Date.YEAR", " year");
|
||||
return ($span != 1) ? "{$span} "._t("Date.YEARS", " years") : "{$span} "._t("Date.YEAR", " year");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user