Referencing the DatePicker field inside of a Group only shows today's date

Support MB Group Referencing the DatePicker field inside of a Group only shows today's date

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #40908
    Dustin DaunceyDustin Dauncey
    Participant

    Hello,

    I'm new to using MB Group fields, but I'm trying to setup one with a repeating/cloneable subfields of DatePicker (basically creating a Start Date and End Date). When I set these values to future dates in either start or end date DatePicker fields, the frontend will only ever show today's date (whether that's yesterday when viewing yesterday or today when viewing today for example).

    Is this a bug or am I perhaps doing something wrong? I was using the DatePicker fields in a separate CPT and it worked perfectly fine, but seems to be an issue inside of the Group field with the DatePicker as subfields.

    I am using the "Save value as timestamp" option too as that seems to be the only manner in which I can display it in the frontend as a real date. I'm using the Bricks Builder theme (v1.7), by the way.

    #40909
    Dustin DaunceyDustin Dauncey
    Participant

    This is the PHP code setup for the custom fields: https://pastebin.com/NwBTgQYQ

    #40918
    PeterPeter
    Moderator

    Hello Dustin,

    It is possible that the Bricks builder is not compatible with MB Group to render the datepicker field on the frontend. I've used this code to display the datepicker field as well

    $groups = rwmb_meta( 'event_group' );
    foreach ($groups as $group) {
    	echo date( 'F j, Y', $group['start_date']['timestamp'] );
    }

    Note: the datepicker field with the option timestamp enabled save the value to the database in an array: timestamp and formatted, for example:

        [start_date] => Array
            (
                [timestamp] => 1678320000
                [formatted] => 2023-03-09
            )

    FYI, Bricks builder maintains the integration with Meta Box so I recommend contacting their support to ask for further assistance. Please read more here https://docs.metabox.io/compatibility/

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.