Friday, May 6, 2011

Re: $this->Time->nice() l10n in hrv (croatian)

I solved the problem:)
I extended the class time..

<?php
App::import('Helper', 'Time');
class NiceHelper extends TimeHelper {

function nice($dateString = null, $userOffset = null) {
if ($dateString != null) {
$date = $this->fromString($dateString, $userOffset);
} else {
$date = time();
}
$format = $this->convertSpecifiers('%a, %e %b %Y, %H:%M',
$date);
return strftime($format, $date);
}
}
?>

in views/ elements

<?php echo $this->Nice->nice($stat['3']['Product']['modified'],2);?>

http://detas.ba

On 5 svi, 23:17, Salines <nikola.parad...@gmail.com> wrote:
> EDIT:
> On 5 svi, 23:10, Salines <nikola.parad...@gmail.com> wrote:> Hi, Boys&Girls,
>
> > I have small problem using $this->Time->nice('2011-04-01 18:00')
> > return me pet, tra 1st 2011, 18:00 ;
>
> *** As you see '1st', i don't need that format :)
>
>
>
>
>
>
>
>
>
> > I need result  in following format: pet, 1 tra 2011, 18:00, where &
> > how  can I do? :)
>
> > Thx

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


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

No comments: