Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-8177

February 29th birthdays not shown in non-leap year

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.4
    • Fix Version/s: 3.0.10-RC1
    • Component/s: Viewing forums
    • Labels:
      None
    • Environment:
      PHP Environment:
      Database:

      Description

      When you are born on february 29th, the birthday list in a non-leap year does not show your birthday because there is no february 29th in that year. As a consequence your birthday is only shown once in four years.
      It may be a better choice to show your birthday in the birthday list of february 28th in non-leap years, probably at the end of the regular february 28th birthdays with a special marking/note.

      P.S. I am not sure whether this should have been issued as bug or feature request

        Activity

        Hide
        naderman Nils Adermann added a comment -

        Joas, do you want to pull request your feb 28 patch then? Didn't see it was from you.

        Show
        naderman Nils Adermann added a comment - Joas, do you want to pull request your feb 28 patch then? Didn't see it was from you.
        Hide
        bantu Andreas Fischer added a comment -

        Yes, patch looks broken. Should have probably been OR instead of AND.

        Also braces around ($now['mday'] == 28) and ($now['mon'] == 2) should be dropped as they are useless. See phpBB/docs/coding-guidelines.html#codelayout

        Show
        bantu Andreas Fischer added a comment - Yes, patch looks broken. Should have probably been OR instead of AND. Also braces around ($now ['mday'] == 28) and ($now ['mon'] == 2) should be dropped as they are useless. See phpBB/docs/coding-guidelines.html#codelayout
        Hide
        bantu Andreas Fischer added a comment -

        Furthermore I think that the logic for determining whether a year is a leap year should be moved into a function and documented.

        Show
        bantu Andreas Fischer added a comment - Furthermore I think that the logic for determining whether a year is a leap year should be moved into a function and documented.
        Hide
        bantu Andreas Fischer added a comment -

        $user->format_date(time(), 'L')

        might as well work for determining whether the current year is a leap year. date('L') also works on PHP 4.4.9, by the way.

        Show
        bantu Andreas Fischer added a comment - $user->format_date(time(), 'L') might as well work for determining whether the current year is a leap year. date('L') also works on PHP 4.4.9, by the way.
        Hide
        nickvergessen Joas Schilling added a comment -

        Fixed the braces, the logic in the query and using format_date(time(), 'L') now.

        Show
        nickvergessen Joas Schilling added a comment - Fixed the braces, the logic in the query and using format_date(time(), 'L') now.

          People

          • Assignee:
            nickvergessen Joas Schilling
            Reporter:
            rogert rogert
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development