Location: PHPKode > projects > Agile Toolkit > atk4-atk4-addons-5a69383/misc/lib/Controller/Fancy.php
   Selection of utilities for making thinsg fancy 

   Due to date functions, this controller requries PHP5.3+

class Controller_Fancy extends AbstractController {
    function fancy_datetime($dt,$now='now'){

        $now=new DateTime($now);
        $dt=new DateTime($dt);

        $rel=$dt>$now?'':' ago';

            return $dt->format($this->api->getConfig('locale/date','d/m/Y'));

        // Zero days, show fancy format
        if($h>1)return $h.' hours'.$rel;
        if($h)return 'a hour'.$rel;

        if($m>1)return $m.' minutes'.$rel;

        return $dt>$now?'about a minute':'just now';
Return current item: Agile Toolkit