1

I have a date and time that works great

format=" %F %j, %Y; %g:%i %a" prints out > December 2, 2017; 7:30 pm

However, in some instances, I don't have the time, but I still want to show the date. I will come back in few weeks and put the time in when its confirmed. In the date picker if I leave the date out it prints 12:00 am Is there a workaround for this.

1 Answer 1

3

You could try something like this:

{if '{my_date_field format="%g:%i %a"}' == "12:00 am"}
{my_date_field format=" %F %j, %Y"} {!-- date without time --}
{if:else}
{my_date_field format=" %F %j, %Y; %g:%i %a"} {!-- date with time --}
{/if}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.