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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.8
    • Fix Version/s: None
    • Component/s: Block: Birthday
    • Labels:
      None
    • Database:
      Any
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      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>

        Attachments

          Activity

            People

            Assignee:
            aborrow Anthony Borrow
            Reporter:
            mrmuehle Guido Hornig
            Participants:
            Component watchers:
            Anthony Borrow
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: