Date in Results in german

This topic contains 2 replies, has 2 voices, and was last updated by kognitoweb kognitoweb 6 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8571
    kognitoweb
    kognitoweb
    Participant

    Hi,
    I realized that the “Date” in the Result field is displayed in ENGLISH, however I want to display it in GERMAN. I couldnt find the position to change this. Ive attached a screenshot. Thanks!

    Attachments:
    You must be logged in to view attached files.
    #8579
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Sorry about the late answer. I had to investigate this problem as I thought the localization was done automatically.
    This is actually a bug, which I will have to fix in the upcoming release.

    Until then, I have put together a temporary fix for you. Put this code into the functions.php file in your active theme directory:

    
    add_filter('asp_pagepost_results', 'asp_loc_dates', 1, 1); 
    function asp_loc_dates( $results ) {
      foreach ($results as $k => $r) {
        if ( empty($r->date) ) continue;
    
        $results[$k]->date = date_i18n( "d. F Y", strtotime($r->date) );
      }
      return $results;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #8613
    kognitoweb
    kognitoweb
    Participant

    Thanks, that solved it!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.