• Resolved locker17

    (@locker17)


    I am using the reg form together with buddypress.

    I have an issue with the date format. I would like to have it shown as d/m/Y but saved in the database as a mysql date format which means YYYY-MM-DD or at least map the xfield in that format.
    Otherwise it will causes problems with the buddypress output which takes the stored d/m/Y format from the maped xfield as m/d/Y.
    Can you point me to the code line where I can chance this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter locker17

    (@locker17)

    Today I found at the logs section 4 lines which say the time and then CRITICAL Mismatch Columns. I mapped 4 fields and get 4 mismatch errors for every user which registers. Why they are throwing this error if the fields mapped correctly to buddypress instead of the mix up with the day and month reported above?

    Plugin Support Sandip Pokhrel

    (@sandippokharel)

    Hi @locker17,

    Thanks for writing in,

    For the date field, you can change the format from the Field Options > Advanced Settings > Date Format. Please refer to the screenshot in the link below for reference.

    https://prnt.sc/ywlePpXPVWN_

    Regarding the ‘column mismatch’ issue, will it be possible for you to send us the log file? You can use the following tools to create a URL and share us with the log file.

    https://encl.io

    We will then look into it and get back to you accordingly.

    Regards!

    Thread Starter locker17

    (@locker17)

    Thanks for the answer. I know how to change the format. Unfortunately your plugin doesnt work the same like the buddypress plugin. As shown in the attached picture buddypress plugin shows the date format as d/m/Y – how I wanted it – but saves it as year-month-day in the database (mysql date format).

    Your plugin is also beeing able to save it as year-month-day but shows it in the same way which is confusing in my country. I need it show as d/m/Y from the date picker and THEN save it as year-month-day in the mapped buddypress xfield. Then other buddypress plugins can work with it correctly.

    Is there a way to fix that?

    https://ibb.co/rbZ2qCR

    Regarding the column mismatch. I think the log were written because I did not have all options at your plugins dropdown list which I have at the buddypress one. When I correct that, there is no more log. So this one is solved I think.

    Plugin Support Sandip Pokhrel

    (@sandippokharel)

    Hi @locker17

    In that case, you can use the following filter to change the date format saved in the database.

    add_filter( 'user_registration_validate_date', 'ur_format_date_field', 10, 4 );
     
    function ur_format_date_field($single_form_field, $data, $filter_hook, $form_id) {
     
       // Change format of the date
     
    }

    In the frontend, you can use the desired date format i.e. d/m/Y. I hope this helps.

    Regards!

    Plugin Support Sandip Pokhrel

    (@sandippokharel)

    Hi @locker17

    Since we haven’t heard from you in a while, I’m going to go ahead and conclude this thread for now. However, if you have any further questions or if there’s anything else we can assist you with, please feel free to continue the conversation.

    Regards!

    Thread Starter locker17

    (@locker17)

    Could you give me some more information how to change the format?
    Do I need to use date() and how to save?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Date format mixup with buddypress’ is closed to new replies.