Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthoriJyrki
    • CommentTimeAug 3rd 2007
     

    Hey again!

    Here's the problem right now. How to localize the dates (created_at, updated_at) found in tables? I've tried the following in one of my views:

    <p><%= t('%name wrote this on %date', {'%name' => questbook_entry.name, '%date' => questbook_entry.created_at}) %></p>
    

    -jyrki

    • CommentAuthorsalavert
    • CommentTimeAug 3rd 2007 edited
     

    try with this

    $date_helper->locale_date($questbook_entry->created_at)
    
    • CommentAuthoriJyrki
    • CommentTimeAug 3rd 2007
     

    Thanks salavert!

    -jyrki

    • CommentAuthordelia
    • CommentTimeMay 27th 2008
     
    hi,
    i am trying to get a localized date in the form "n Weekday", for example, 31 Wednesday (31 Miércoles). Anybody knows how to achieve this?

    i have done this:

    $timestamp = Ak::getTimestamp($iso_date);
    $format = Ak::locale('j D');
    return Ak::getDate($timestamp, $format);

    but i got an error.......
    •  
      CommentAuthorbermi
    • CommentTimeMay 30th 2008
     

    delia, I think you're missusing Ak::locale('j D');

    Ak::locale looks for an index on the $locale array in your config/locales/LOCALE.php files

    As an example for i18n a date and months, you can do something like:

    On your locale file

    $locale['full_text_date'] = "%s %d of %s, year %d";
    $locale['days'] = "Sunday,Monday,Tuesday....";
    $locale['months'] = "January,February.....";
    

    In a helper

    function full_text_date(){
        $days = Ak::toArray(Ak::locale('days'));
        $months = Ak::toArray(Ak::locale('months'));
        return sprintf($locale['full_text_date'], $days[date('w')], date('j'), $months[date('n')+1], date('Y'));
    }
    

    Hope it helps

    • CommentAuthordelia
    • CommentTimeJun 3rd 2008
     
    thanks Bermi. it helps

    (y perdona por las preguntas estúpidas - se me nota a la legua que estoy empezando. Intento buscar información antes de preguntar, pero todavía hay muy poca documentación sobre el framework me parece)
    •  
      CommentAuthorbermi
    • CommentTimeJun 3rd 2008
     

    delia, I'd like the Akelos community to embrace the "There are no dumb questions culture", so don't worry … y bienvenidas sean tus preguntas :)

Add your comments
    Username Password
  • Format comments as