public class CalendarUtils
extends java.lang.Object
Constructor and Description |
---|
CalendarUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copyDateTo(java.util.Calendar from,
java.util.Calendar to)
Copy only date information to a new calendar.
|
static int |
getDay(java.util.Calendar calendar) |
static int |
getDayOfWeek(java.util.Calendar calendar) |
static java.util.Calendar |
getInstance() |
static java.util.Calendar |
getInstance(java.util.Date date) |
static int |
getMonth(java.util.Calendar calendar) |
static int |
getYear(java.util.Calendar calendar) |
static void |
setToFirstDay(java.util.Calendar calendar)
Set the provided calendar to the first day of the month.
|
public static java.util.Calendar getInstance(@Nullable java.util.Date date)
date
- Date to pull date information from@NonNull public static java.util.Calendar getInstance()
public static void setToFirstDay(java.util.Calendar calendar)
calendar
- Calendar to modify to be at the first fay of the monthpublic static void copyDateTo(java.util.Calendar from, java.util.Calendar to)
from
- calendar to copy fromto
- calendar to copy topublic static int getYear(java.util.Calendar calendar)
public static int getMonth(java.util.Calendar calendar)
public static int getDay(java.util.Calendar calendar)
public static int getDayOfWeek(java.util.Calendar calendar)