Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-5279

I'm offering to add function which will get months' and days' names from lang files

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 1.9.4
    • General
    • None
    • All
    • MOODLE_19_STABLE

      I'm offering add function which will get months' and days' names (and their acronym) from lang files. Because locale often include words in incorrect form.

      For example in russian:

      We speak 2'nd of September as [vtoroe sentiabria] but just [sentiabr] if we mean name of month. But in locale %B correspond to [sentiabria] and it looks not well.

      It will necessary to add monthes and acronyms to calendar.php

      function strftime_ex($format, $date, $fixday = true) {

      global $CFG;

      static $strftimedaydatetime;

      if ($format == '') {

      if (empty($strftimedaydatetime))

      { $strftimedaydatetime = get_string('strftimedaydatetime'); }

      $format = $strftimedaydatetime;

      }

      /// correcting dates (dlnsk) %%62%%

      $str = get_string(strtolower(date('F', $date)), 'calendar'); // January

      $format = str_replace('%B', $str, $format);

      $str = get_string(strtolower(date('l', $date)), 'calendar'); // Monday

      $format = str_replace('%A', $str, $format);

      $str = get_string(strtolower(date('M', $date)), 'calendar'); // Jan

      $format = str_replace('%b', $str, $format);

      $str = get_string(strtolower(date('D', $date)), 'calendar'); // Mon

      $format = str_replace('%a', $str, $format);

      if (!empty($CFG->nofixday))

      { // Config.php can force %d not to be fixed. $fixday = false; }

      else if ($fixday)

      { $formatnoday = str_replace('%d', 'DD', $format); $fixday = ($formatnoday != $format); }

      if ($fixday)

      { $datestring = strftime($formatnoday, $date); $daystring = str_replace(' 0', '', strftime(' %d', $date)); $datestring = str_replace('DD', $daystring, $datestring); }

      else

      { $datestring = strftime($format, $date); }

      return $datestring;

      }

            moodle.com Moodle HQ
            dlnsk Dmitry Pupinin (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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