Support » Plugin: Custom Content Shortcode » Inconsistent date output

  • I’m trying to put together a very simple formula that alternates content based on a date – if it’s before X, it says “story will be published”. If it’s on or after, it says “story was published”. I’ve thought I had this done several times, only to realize the output isn’t as anticipated. Now, I’m realizing it may not be me at all.

    “Story” [if field=date before=’2018-08-10′] will be [else] was[/if] published on 10 August 2018.
    “Story” [if field=date before=’2018-08-11′] will be [else] was[/if] published on 11 August 2018.
    “Story” [if field=date before=’2018-08-12′] will be [else] was[/if] published on 12 August 2018.

    For example, in two different posts, the same code gives different results.

    Code (same for both posts)

    “Story” [if field=date before=’2018-08-10′] will be [else] was[/if] published on 10 August 2018.
    “Story” [if field=date before=’2018-08-11′] will be [else] was[/if] published on 11 August 2018.
    “Story” [if field=date before=’2018-08-12′] will be [else] was[/if] published on 12 August 2018.

    Result 1 (draft post that has seen multiple versions, was published once by mistake)
    “Story” was published on 10 August 2018.
    “Story” was published on 11 August 2018.
    “Story” was published on 12 August 2018.

    Result 2 (code copied and pasted from above, never published, never saved)
    “Story” was published on 10 August 2018.
    “Story” was published on 11 August 2018.
    “Story” will be published on 12 August 2018.

    Publishing the above in a post also gives different results for the same set of formulas used twice. The first, gives the ‘will be’ result in the last line, while the second gives the ‘was’ result.

  • The topic ‘Inconsistent date output’ is closed to new replies.