comparing months of start- and end dates with an if conditional to format output

I would like to use two different output formats for events, depending if they cross over into another month or not:

Within a month 15. - 23. Nov
(Not showing the month for the start date)

Crossing over: 29. Nov - 3. Dec
(in this case, showing the month for start and end)

For this, I need to compare the month, and depending on if it's equal or different. I was experimenting retrieving the month with this tag {seminar_datum:start_date format='%M'} and comparing it with the same tag for the month of the end date with an {if ...} conditional, but I'm either getting PHP errors from EE about an invalid conditional, or end up comparing the tags instead of what's in the %M variable.

A pointer how to go about that would be helpful.

Regards, René
1 person has
this problem