Fix ambiguous abs() call in get_approximate_relative_time_string()
This commit is contained in:
parent
fbfeb95932
commit
9002b02469
1 changed files with 5 additions and 2 deletions
|
|
@ -49,10 +49,13 @@ namespace fc {
|
||||||
|
|
||||||
|
|
||||||
string ago = default_ago;
|
string ago = default_ago;
|
||||||
if (event_time > relative_to_time)
|
int32_t seconds_ago = relative_to_time.sec_since_epoch() - event_time.sec_since_epoch();
|
||||||
|
if (seconds_ago < 0)
|
||||||
|
{
|
||||||
ago = " in the future";
|
ago = " in the future";
|
||||||
|
seconds_ago = -seconds_ago;
|
||||||
|
}
|
||||||
stringstream result;
|
stringstream result;
|
||||||
uint32_t seconds_ago = abs(relative_to_time.sec_since_epoch() - event_time.sec_since_epoch());
|
|
||||||
if (seconds_ago < 90)
|
if (seconds_ago < 90)
|
||||||
{
|
{
|
||||||
result << seconds_ago << " second" << (seconds_ago > 1 ? "s" : "") << ago;
|
result << seconds_ago << " second" << (seconds_ago > 1 ? "s" : "") << ago;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue