Support

Account

Home Forums General Issues How to split the Date-Picker-Value

Helping

How to split the Date-Picker-Value

  • Hello Guys! Befor I am starting to ask: I am very sorry for my english. But I hope you will understand me, what I want, because I am an beginner as well.

    When the Date is picked, it shows the Weekday (like Monday) and the Date (16.2.).

    In the Value of the Settings stands: “l, d.m”
    So, Its generate: Monday, 16.2. (for example)

    But: I need the “Monday” (the “l” in the value”) in the next row. Like in a extra <p>-Tag.

    It should be like:
    Monday,
    16.2

    (like: <p class=”weekday”>Monday</p> <p class=”date”>16.2.</p>)

    The big Question is: How? Is there a simple answer?

    Thank you for reading!

  • found an answer:

    In the Settings:
    last choice, where you can decide your own format:

    l,d.m

    if(get_field(‘MY-FIELD-NAME’)):
    {
    $myString = get_field(‘MY-FIELD-NAME’);
    $myArray = explode(‘,’, $myString);

    echo ‘<p class=”date_weekday”>’ . $myArray[0] . ‘</p>’;
    echo ‘<p class=”date_date”>’ . $myArray[1] . ‘</p>’;
    }
    endif;

    l = weekday -> first array ([0])
    d.m = day and Month -> second array ([1])

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘How to split the Date-Picker-Value’ is closed to new replies.