If I were doing this, I would use
Note the first term in the rule. The construct
if($EndDate!=0) returns an indeterminate result because $EndDate is a date-type attribute, the “zero state” is undefined. What you want to test for is “there is an end date”, that is “exists $EndDate is True”. Thus
The rest of the rule uses the form of the interval operator that compares start and end dates.
Be aware, though, that the interval operator is dynamic – it updates itself continually. So if you used the rule I suggested, the $Subtitle would be continually updated (watch the seconds in the GIF):
This can be interesting**, but it might also be an ongoing computation drain, potentially, if you have a lot of this going on in a file. If that is the case, then the alternate approaches mentioned by @mwra might be more attractive.
** For example, we can watch time tick away as we neglect our chores and never reach the $EndDate