public class

BlogPostsCalendar

extends Object
java.lang.Object
   ↳ com.atlassian.confluence.pages.BlogPostsCalendar

Class Overview

Helper bean that turns a list of blog posts into a monthly calendar.

Summary

Public Constructors
BlogPostsCalendar(Date coversDate, List blogPosts, String spaceKey, DateFormatter formatter)
Construct a new calendar.
Public Methods
String formatMonthYear()
String getCurrentMonth()
Get the next year/month in the form yyyy/MM
int getDaysInMonth()
Gets the total number of days in the month being calendared.
BlogPost getFirstPostInNextMonth()
BlogPost getLastPostInPreviousMonth()
String getNextMonth()
Get the next year/month in the form yyyy/MM
List<BlogPost> getPostsForDay(int dayOfMonth)
Get the posts made on a particular day of the month
List<BlogPost> getPostsForMonth()
Get all the posts for the month
String getPreviousMonth()
Get the previous year/month in the form yyyy/MM
String getSpaceKey()
int getStartingDayOfMonth()
Get the starting day of the month as an offset from Sunday (i.e.
void setFirstPostInNextMonth(BlogPost firstPostInNextMonth)
void setLastPostInPreviousMonth(BlogPost lastPostInPreviousMonth)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BlogPostsCalendar (Date coversDate, List blogPosts, String spaceKey, DateFormatter formatter)

Construct a new calendar. Takes a date that falls within the month being calendared, and a list of blog posts that are to populate the calendar. Any blog post falling outside the given month will be ignored quietly.

Parameters
coversDate a date falling within the month being calendared
blogPosts the blog posts to populate the calendar
spaceKey the space key to build the calendar for

Public Methods

public String formatMonthYear ()

public String getCurrentMonth ()

Get the next year/month in the form yyyy/MM

Returns
  • the current month og this calendar

public int getDaysInMonth ()

Gets the total number of days in the month being calendared.

Returns
  • the total number of days in the month being calendared

public BlogPost getFirstPostInNextMonth ()

public BlogPost getLastPostInPreviousMonth ()

public String getNextMonth ()

Get the next year/month in the form yyyy/MM

Returns
  • the next month for this calendar

public List<BlogPost> getPostsForDay (int dayOfMonth)

Get the posts made on a particular day of the month

Parameters
dayOfMonth the day of the month to get the posts for (starting at 1)
Returns
  • the blog posts made on that day

public List<BlogPost> getPostsForMonth ()

Get all the posts for the month

Returns
  • the blog posts made in this calendar's month

public String getPreviousMonth ()

Get the previous year/month in the form yyyy/MM

Returns
  • the previous month for this calendar

public String getSpaceKey ()

public int getStartingDayOfMonth ()

Get the starting day of the month as an offset from Sunday (i.e. Sunday is 0, Monday 1, etc.) This is NOT COMPATIBLE with the constants on the Calendar class.

Returns
  • the starting day of the month as an offset from Sunday

public void setFirstPostInNextMonth (BlogPost firstPostInNextMonth)

public void setLastPostInPreviousMonth (BlogPost lastPostInPreviousMonth)