MonthDisplayHelper
open class MonthDisplayHelper
Helps answer common questions that come up when displaying a month in a 6 row calendar grid format. Not thread safe.
Summary
Public constructors
MonthDisplayHelper
MonthDisplayHelper(
year: Int,
month: Int,
weekStartDay: Int)
Parameters |
year |
Int: The year. |
month |
Int: The month. |
weekStartDay |
Int: What day of the week the week should start. |
MonthDisplayHelper
MonthDisplayHelper(
year: Int,
month: Int)
Public methods
getColumnOf
open fun getColumnOf(day: Int): Int
Return |
Int |
Which column day is in. |
getDayAt
open fun getDayAt(
row: Int,
column: Int
): Int
Parameters |
row |
Int: The row, 0-5, starting from the top. |
column |
Int: The column, 0-6, starting from the left. |
Return |
Int |
The day at a particular row, column |
getDigitsForRow
open fun getDigitsForRow(row: Int): IntArray!
Parameters |
row |
Int: Which row (0-5). |
Return |
IntArray! |
the digits of the month to display in one of the 6 rows of a calendar month display. |
getFirstDayOfMonth
open fun getFirstDayOfMonth(): Int
getMonth
open fun getMonth(): Int
getNumberOfDaysInMonth
open fun getNumberOfDaysInMonth(): Int
Return |
Int |
The number of days in the month. |
getOffset
open fun getOffset(): Int
Return |
Int |
The offset from displaying everything starting on the very first box. For example, if the calendar is set to display the first day of the week as Sunday, and the month starts on a Wednesday, the offset is 3. |
getRowOf
open fun getRowOf(day: Int): Int
Return |
Int |
Which row day is in. |
getWeekStartDay
open fun getWeekStartDay(): Int
getYear
open fun getYear(): Int
isWithinCurrentMonth
open fun isWithinCurrentMonth(
row: Int,
column: Int
): Boolean
Return |
Boolean |
Whether the row and column fall within the month. |
nextMonth
open fun nextMonth(): Unit
Increment the month.
previousMonth
open fun previousMonth(): Unit
Decrement the month.