com.bradrydzewski.gwt.calendar.client.monthview
Class MonthViewDateUtils

java.lang.Object
  extended by com.bradrydzewski.gwt.calendar.client.monthview.MonthViewDateUtils

public class MonthViewDateUtils
extends Object

Contains date-related utilities with logic required to generate the MonthView.

Author:
Carlos D. Morales

Constructor Summary
MonthViewDateUtils()
           
 
Method Summary
static Date firstDateShownInAMonthView(Date dayInMonth, int firstDayOfWeek)
          Calculates the first date that should be displayed in a month view.
static int monthViewRequiredRows(Date dayInMonth, int firstDayOfWeek)
          Dynamically calculates the number of rows required to display all the days in a month.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonthViewDateUtils

public MonthViewDateUtils()
Method Detail

firstDateShownInAMonthView

public static Date firstDateShownInAMonthView(Date dayInMonth,
                                              int firstDayOfWeek)
Calculates the first date that should be displayed in a month view. Depending on the year and month, sometimes, viewing at a month will show days from the previous month in the first week.

Parameters:
dayInMonth - Any day in the month that is being visualized in a month view
firstDayOfWeek - The day the weeks start on the month view, Sunday is 0, Monday is 1, etc.
Returns:
The first date that should appear on the first week of a month view

monthViewRequiredRows

public static int monthViewRequiredRows(Date dayInMonth,
                                        int firstDayOfWeek)
Dynamically calculates the number of rows required to display all the days in a month.

Parameters:
dayInMonth - Any day in the month that is being visualized through the month view
firstDayOfWeek - The day the weeks start on the month view, Sunday is 0, Monday is 1, etc.
Returns:
The number of rows (which represent weeks in the month view) required to display all days in the month view


Copyright © 2012. All Rights Reserved.