ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Matching two months urgent help

October 26, 2012 5:31am

Subscribe [1]
  • #1 / Oct 26, 2012 5:31am

    radiusmedia

    2 posts

    Hi there

    Trying to get two months that match to display some different content.

    For example:

    If start_date month is Oct and finish_date month is Oct, then display something.

    See code below

    <?php
    $start_date = “{start_date format='%M'}”;
    $finish_date = “{finish_date format='%M'}”;

    if ($start_date == $finish_date) {
    $finish_date2 = ' {finish_date format="%d"}’;
    }
    else {
    $finish_date2 = ' {finish_date format="%M %d"}’;
    }
    ?>

    In code above some records have the same month, however I can not get them to match.

    Can someone please tell me what I am doing wrong, I just don’t understand why Oct == Oct does not much

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases