Wednesday, December 23, 2009

Issue with timeAgoInWords() method

Hi all,

I have a probelem with the 'userOffset' option of
http://api.cakephp.org/class/time-helper#method-TimeHelpertimeAgoInWords

This snippet of test code in view
<?php
echo $activity['Activity']['modified'];

echo $time->timeAgoInWords(
$activity['Activity']['modified'],
array('userOffset' => 5)
);

echo $time->timeAgoInWords(
$activity['Activity']['modified'],
array('userOffset' => 4)
);
?>

outputs something like:

2009-12-23 10:59:30
7 hours, 4 minutes ago
7 hours, 4 minutes ago

meaning that no matter what the userOffset option contains, no offset
seems to be applied, I would have expected a 1 hour difference in
between the two outputs.

Any hint or suggestion?

Best,

Mario

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: