Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-3104

in Birthday block: show date in international format March -> März using LC_TIME and strftime

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Trivial Trivial
    • None
    • 1.9.8
    • Block: Birthday
    • None
    • Any
    • Easy
    • MOODLE_19_STABLE

      I modified the funtion in block_birthday.php to make it German by using strftime instead of date an LC_TIME
      If some one knows how to get the Language variable can improve it.

      <code>
      function get_month_day($date, $format='ISO') {

      $year = date('Y');

      switch ($format)

      { case 'USA': $period = explode('.',$date); $month = $period[0]; $day = $period[1]; break; case 'ISO': $period = explode('-',$date); $month = $period[1]; $day = $period[2]; break; case 'EUR': $period = explode('.',$date); $month = $period[1]; $day = $period[0]; break; default : error('Invalid field type'); }

      // $return = date('M d',mktime(0,0,0,$month,$day,$year));
      setlocale(LC_TIME, 'de_DE.UTF8');
      $return = strftime('%d. %B', mktime(0,0,0,$month,$day,$year));
      return $return;

      }
      </code>

        1. patch.txt
          0.8 kB
          Timothy Gonzales

            aborrow Anthony Borrow
            mrmuehle Guido Hornig
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.