WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Heirem
    Member
    Posted 5 years ago #

    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

  2. Heirem
    Member
    Posted 5 years ago #

    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)];
    }

    ;)

Topic Closed

This topic has been closed to new replies.

About this Topic