[FIX] Using ISO-8601:1988 year standard (%g) instead of dividing year by 100 (%G)

This commit is contained in:
veselcraft 2021-01-04 12:50:41 -05:00
parent 057e6c5c63
commit 051b7d7434

View file

@ -32,10 +32,10 @@ class DateTime
return $diff->i === 5 ? tr("time_exactly_five_minutes_ago") : tr("time_minutes_ago", $diff->i);
} else if($this->timestamp >= strtotime("-1day midnight")) { # Yesterday
return tr("time_yesterday") . tr("time_at_sp") . ovk_strftime_safe("%X", $this->timestamp);
} else if(ovk_strftime_safe("%G", $this->timestamp) === ovk_strftime_safe("%G")) { # In this year
} else if(ovk_strftime_safe("%g", $this->timestamp) === ovk_strftime_safe("%g")) { # In this year
return ovk_strftime_safe("%e %h ", $this->timestamp) . tr("time_at_sp") . ovk_strftime_safe(" %R %p", $this->timestamp);
} else {
return ovk_strftime_safe("%e %B %G ", $this->timestamp) . tr("time_at_sp") . ovk_strftime_safe(" %X", $this->timestamp);
return ovk_strftime_safe("%e %B %g ", $this->timestamp) . tr("time_at_sp") . ovk_strftime_safe(" %X", $this->timestamp);
}
}