Multi month events class

Home Forums Calendar Products Events Calendar PRO Multi month events class

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1330624
    Dan
    Participant

    Hello,

    I’m currently building a customisation to the events list view that uses isotope to filter through months.

    I need to add a class to each event listing for every month the event takes place in. Obviously, I can add the start & end months with tribe_get_start_date and tribe_get_end_date, but I can’t seem to work out a way to add any months in between?

    For instance, I have an event that runs from November – January. With tribe_get_start_date and tribe_get_end_date I can generate month-11 and month-01 classes, but I can’t generate a month-12 class, so when I select December from the filters, the event doesn’t display.

    Is there an existing function that would make this possible?

    Cheers
    Ben

    #1332087
    Andras
    Keymaster

    Hey Ben,

    Thanks for reaching out! That looks like an awesome customization you are working on.

    Though we are limited in supporting customization, I should be able to give you some tips on this one.

    To the best of my knowledge there is no direct function to get the inbetween months. It should be possible with some workaround.

    When you have the start and end date, then get the difference (number of days of months) and that should help you generate the new class.

    If it’s a specific case (Nov – Jan), then you can do a comparison like if end month is smaller then start month and do proper adjustments like:

    for ( increase month ):  if month is bigger than 12 then deduct 12

    Hope this helps. Let me know.

    Cheers,
    Andras

    #1342423
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Multi month events class’ is closed to new replies.