Bug Report #1152

date::timespan_string shouldn't return last difference if it's empty

Added by Andy Stanberry - almost 3 years ago. Updated almost 3 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:Kiall Mac Innes % Done:

100%

Category:Helpers
Target version:2.3.3
Resolution:fixed Points:

Description

date::timespan_string(0, 3600) returns '1 hour and 0 seconds'

it should just return '1 hour'

Changing date.php:378
from

if ($name !== $last AND $amount === 0)

to

if ($amount === 0)

resolves the problem.

I can't see any reason to not skip the last section if it's 0

Associated revisions

Revision 4312
Added by Kiall Mac Innes almost 3 years ago

fixes #1152 - Thanks Andy

Revision 4313
Added by Kiall Mac Innes almost 3 years ago

Merged r4312 from trunk - refs #1152

History

Updated by Kiall Mac Innes almost 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset r4312.

Updated by Kiall Mac Innes almost 3 years ago

  • Assignee set to Kiall Mac Innes

Updated by Kiall Mac Innes almost 3 years ago

  • Resolution set to fixed

Also available in: Atom PDF