Date TV use text as default

I’m using getResources to pull pages which list System Outages. I have a Start TV and an End TV so that when listing outages it shows: September 1, 2021 10:00AM - September 7, 2021 7:00AM. That works great. But if I omit the End TV, rather than show a date, I want it to display “Ongoing”, hence: September 1, 2021 10:00AM - Ongoing

I’ve tried the default modifier as well as default within the TV setup but neither works and I assume it is because it is dealing with a date and doesn’t want to use text.

Anyone know how I can achieve my goal?

I’m pretty sure, the default modifier should work:

  • Can you post your getResources call and the content of &tpl (if it is a chunk)?
  • What is the “Input Type” of your TVs? Date?

Here is the line in the chunk:

[[+tv.OutageStartDate:strtotime:date=`%A, %B %e, %Y, %r`]] - [[+tv.OutageEndDate:default=`Ongoing`:strtotime:date=`%A, %B %e, %Y, %r`]]

I’m using a Date template variable with the default output. I’ve tried text and string.

I believe all this output modifiers can’t just be concatenated like this.

Does this work?

[[+tv.OutageEndDate:is=``:then=`Ongoing`:else=`[[+tv.OutageEndDate:strtotime:date=`%A, %B %e, %Y, %r`]]`]]

Just putting default at the end might also work:

[[+tv.OutageEndDate:strtotime:date=`%A, %B %e, %Y, %r`:default=`Ongoing`]]

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.