Signature of some TimeHelper functions has changed

Published on and tagged with cakephp  programming  tip

In the coming Release Candidate 4 (RC4) of CakePHP, two function signatures in the TimeHelper have changed so that they are no longer compatible with older versions (and so they may break your code). The function timeAgoInWords() has changed from:

function timeAgoInWords ($datetime_string, $return = false, 
                                   $backwards = false)

to:

function timeAgoInWords ($datetime_string, $format = 'j/n/y', 
                                   $backwards = false, $return = false)

And the function relativeTime() has changed from:

function relativeTime ($datetime_string, $return = false)

to:

function relativeTime ($datetime_string, $format = 'j/n/y', 
                              $return = false)

So, do not forget to check your code for calls to the aforementioned functions when you update to RC4!

Bake a comment




(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License