Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Birthday Format on Profile Extender plugin

Hi,

I can not find how to change the format of the user birthday date to spanish locale.

I found in this thread - https://vanillaforums.org/discussion/comment/220487#Comment_220487

('Birthday Format','F j, Y')

I put on may locale file $Definition['Birthday Format'] = 'j F Y'; and it change order (but the month is remains on inglish)

Does anyone know how change the format of Birthday on a user profile?

Thanks.

Comments

  • On line 421 of plugins/profileextender/class.profileextender.plugin.php, could you try changing these lines (after you made a backup of your forum and the original file!):

                    // Do not use Gdn_Format::Date because it shifts to local timezone
                    $BirthdayStamp = Gdn_Format::toTimestamp($Sender->User->DateOfBirth);
                    if ($BirthdayStamp) {
                        $ProfileFields['DateOfBirth'] = date(t('Birthday Format', 'F j, Y'), $BirthdayStamp);
                        $AllFields['DateOfBirth'] = array('Label' => t('Birthday'), 'OnProfile' => true);
                    }
    

    To


    See if that fixes the problem?

  • RiverRiver MVP
    edited August 2016

    @steam said:
    Hi,

    I can not find how to change the format of the user birthday date to spanish locale.

    I found in this thread - https://vanillaforums.org/discussion/comment/220487#Comment_220487

    ('Birthday Format','F j, Y')

    You found a BUG! regarding profile extender and BirthDate translation to other languages.

    the date() command won't translate to other languages.

    To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().

    http://php.net/manual/en/function.date.php

    you could use above change as suggested in previous comment, if you prefer to modify plugin.

    or you could live with a different format.

    with date()

    m Numeric representation of a month, with leading zeros

    $Definition['Birthday Format'] = 'j/m /Y';

    or

    $Definition['Birthday Format'] = 'j/m/y';

    or you could make your own plugin that displays Birthday.

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • @Caylus dijo:
    On line 421 of plugins/profileextender/class.profileextender.plugin.php, could you try changing these lines (after you made a backup of your forum and the original file!):

                    // Do not use Gdn_Format::Date because it shifts to local timezone
                    $BirthdayStamp = Gdn_Format::toTimestamp($Sender->User->DateOfBirth);
                    if ($BirthdayStamp) {
                        $ProfileFields['DateOfBirth'] = date(t('Birthday Format', 'F j, Y'), $BirthdayStamp);
                        $AllFields['DateOfBirth'] = array('Label' => t('Birthday'), 'OnProfile' => true);
                    }
    

    To


    See if that fixes the problem?

    Your solution I've tried it and it works!

    I guess with the new version of plugin will be updated.

    Thanks for the temporary solution.

  • You found a BUG! regarding profile extender and BirthDate translation to other languages.
    ....

    $Definition['Birthday Format'] = 'j/m /Y';

    or

    $Definition['Birthday Format'] = 'j/m/y';

    or you could make your own plugin that displays Birthday.

    Yes, as the option I can change to numeric date format.

    Thanks for another solution without modifying the plugin.

Sign In or Register to comment.