• Good Morning,

    I just updated the plugin 1.0.1 and I am very happy with it. There is one issue, the actual birthday is off by one day. It shows the birthday as 1 day earlier than the entered birthday. Can you take a look at this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • It’s true.

    In line 143 the gmt_offset is subtracted from the birthday timestamp.

    if(!is_numeric($userobj->value)) {
    $bdate = strtotime($userobj->value) + $this->serveroffset;
    }

    This is very weird. If the birthday is 6 Mar 2012, the timestamp will be
    1330992000. We live in Cura?ao in GMT-4 so the ‘serveroffset’ = -4.

    Now 1330992000 – 4 = 1330991996 is March 5, 2012 11:59:56 PM. just 4 SECONDS earlier and thus the wrong date.

    Not very clear why the serveroffset needs to be calculated, since a birthday always happens at 00:00:00 (no time is set in the birthday field).

    So I just removed the offset for now:

    if(!is_numeric($userobj->value)) {
    $bdate = strtotime($userobj->value); // + $this->serveroffset;
    }

    Thread Starter dcsonic

    (@dcsonic)

    Thank you for the reply. That fixed the date bug, but I have another problem where the username is not displayed.

    I get the avatar thumbnail as a link, and it says “Happy birthday to !”, but it does not display the person’s name whose birthday it is.

    Any help would be greatly appreciated!

    Hi Dsonic, is it showing the username or the common name?
    I.e. did you fill in the full name for the person?
    Just guessing here, since in our site the name shows up normally.

    Thread Starter dcsonic

    (@dcsonic)

    It was really weird as the Today’s birthdays would show the Avatar of the person and just say “Happy Birthday to !” with no name. Though the upcoming birthdays would show the person’s name and no avatar. I ended up modifying the code to use the upcoming birthday as the today’s birthday so the name would show. That’s all we wanted, though the avatar would be nice as well, it wasn’t a requirement for us.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bug – Birthday off by one day’ is closed to new replies.