We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22935
    • 23 Posts
    Simply put, can you have a date formatter widget output the date in different formats depending on different conditions? I have two TV’s set up in a document, one is the date an event starts, the other is the date the event ends. Sometimes though, the event is only one day, in which case only the start date needs to be filled out. The problem is, the date format for [*StartDate*] is:
    "MM DD". and the format for [*EndDate*] is -DD, YYYY. When both TVs are used for a multiple day event, the date is displayed as so:
    "February 26-27, 2010" for example. You see that if only the date for [*StartDate*] is entered, I end up with no year displayed. Is it possible to set [*StartDate*] so that it will only display the Year when [*EndDate*] is left Empty? Or maybe to have the default output of [*EndDate*] be the year entered into [*StartDate*]? And just in case anyone asks, no I cannot add a third TV for only single day events, that’s going to be too complicated for the people i’m making the site for.
      • 3749
      • 24,544 Posts
      If you install PHX, you could have a conditional that showed another version of [*StartDate*] showing just the year if [*EndDate*] is empty.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting