• I just started using Simple Calendar to track “exceptions” (primarily cancellations) for classes on a regular schedule (the “Exceptions” block just to the right of the schedule table), and I’ve got it working as I’d like except for one simple thing… I’d like the date ordinal suffix to be superscript. I’ve found multiple resources explaining how to do exactly what I want, and they all agree that the PHP date format in one of these calendar definitions should work:

    <strong>[start-date format="D, M j\<\s\u\p\>S\<\/\s\u\p\>"]:</strong> [title]

    or…

    <strong>[start-date format="D, M j<\s\up>S</\s\up>"]:</strong> [title]

    I’ve tried both, but I’m currently using the one on top (just in case a future version of PHP adds more characters that it interprets as functional, as 5.2.2 did). Neither of them work. It seems that Simple Calendar might be stripping everything out except for one of the backslashes. My page code contains a span with this property. Note the extra “\” inside the quotes, which disappears if I just use the “D, M jS” format without trying to add in the superscript tags.

    data-event-format="D, M jS\"

    Is there something I can do in my calendar definition to fix this? Am I making an error I can’t find? Or is it something that can’t be done without an update to Simple Calendar?

    Note that the calendar on the linked page only shows anything if there are calendar entries labeled as exceptions within the upcoming 60 days, so depending on when you look at this, there might not be any to see (there’s one right now)

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Erik Harris

    (@eharris)

    Additional note: I also tried setting the date format within the “Advanced” tab for the calendar, but that interface appears to have a more significant issue with embedded tags. Upon saving my custom date code, it changed it to D, M j\S\, which is obviously problematic, since it just displays “S” in place of the ordinal suffix.

    Plugin Support john

    (@johnweru)

    Hi Erik,

    Thanks for reaching out to us.

    About your query here, Unfortunately, the format parameter only supports PHP date format characters, so HTML such as “<sup>” isn’t supported. As a result, the ordinal suffix cannot currently be rendered as superscript using the event template tags alone. Achieving this would require a custom code modification to the plugin or an enhancement to the plugin itself. I have added this as a feature request for consideration by the development team.

    Should you have any questions in the meantime, please feel free to reach out once again.

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.