WordPress.org

Support

Support » Requests and Feedback » wp-includes/locale.php: get_month() & get_weekday()

wp-includes/locale.php: get_month() & get_weekday()

  • Hello,
    Not really a big bug, but a big improvement 😉
    Voila :

    function get_weekday($weekday_number) {
      if ($weekday_number > 6) $weekday_number = 0;
      if ($weekday_number < 0) $weekday_number = 6;
      return $this->weekday[$weekday_number];
    }

    and

    function get_month($month_number) {
      if ($month_number > 12) $month_number=1;
      if ($month_number < 0) $month_number=12;
      return $this->month[zeroise($month_number, 2)];

    The class Wp-locale is old and I am surprised it has not evolved since version 2.1. But perhaps I am proposing a mistake …
    Cordially
    Heirem

Viewing 1 replies (of 1 total)
  • oupss
    Sorry for the mistake, you must read this :

    function get_month($month_number) {
      if ($month_number > 12) $month_number=1;
      if ($month_number < 1) $month_number=12;
      return $this->month[zeroise($month_number, 2)];
    }

    😉

Viewing 1 replies (of 1 total)
  • The topic ‘wp-includes/locale.php: get_month() & get_weekday()’ is closed to new replies.
Skip to toolbar