WordPress.org

Ready to get started?Download WordPress

Forums

Availability Calendar
[resolved] Add class 'current-month' to current month's div (4 posts)

  1. jardokraka
    Member
    Posted 1 year ago #

    First off, thank you very much for this plugin.

    Would it be possible to make it so that the current month's div gets class 'current-month'?

    An option to display just the current month (and, better yet, previous, current and next months) would be great.

    Displaying the whole year doesn't fit well into some use cases.

    http://wordpress.org/extend/plugins/availability/

  2. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Thanks for the feedback!

    I have committed version 0.2.2, which includes a number of new classes assigned to the calendars.

    Looks like you know what you're doing in terms of styling etc, so suggest you take a look at the output produced by the new release.

    Hope this is what you were looking for.

  3. jardokraka
    Member
    Posted 1 year ago #

    Steve,

    Thank you very much for these additions. This is definitely a step in the right direction.

    Let me explain what I'm trying to accomplish. Since there's no option in the admin to specify which months are to be displayed on the website, I can use css to hide the months I don't need:

    div.wp-availability-month {
    	display: none;
    }
    
    div.wp-availability-month.month-previous,
    div.wp-availability-month.month-current,
    div.wp-availability-month.month-next {
    	display: block;
    }

    Now that I've gotten around to actually implementing it (it works great, thank you yet again!), it has occured to me that it makes much more sense (in my particular use case) to display just the current month and several months ahead (what's the point of showing past months?).

    Perhaps you could add month-next-1 (for the month after the next one) and month-next-2 (and maybe so forth)? Perhaps you could come up with a better naming convention.

    Ideally I'd expect this to be configurable through the plugin settings, as right now I'm just hiding unneeded div's via css, but they're still in the code; on the other hand, this is such a lightweight plugin with no bloat, and that's good. Just a little bit more flexibility would make it perfect, imo.

    While we're at it, I have a question. It's November now, and I have a suspicion that when it's December soon, only one month will be displayed (as it's the only one remaining for this year), requiring me to switch to year 2013 to be able to see availability for Jan 2012. Is that so?

    I am trying to find a way to display availability for a period a few months ahead, so that, say, 3-4 concurrent months are displayed at all times -- the current one plus a a few more.

    That is to say, in December I would like to be able to show December 2012, Jan 2013, Feb 2013, and maybe March 2013.

    Again, thank you very, very much.

  4. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    Hiya,

    I thought this would be your approach to the styling.

    Thanks for all the feedback, I'm glad you're finding the plugin useful and offering suggestions for improvement.

    With regards to the displaying of months rather than years, it's going to be a case of finding the time to implement this feature.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.