The calendar wrapper tool can be used later

/** * check whether a date is a weekend, i.e., Saturday/Sunday ** @param calendar * @return Check whether a date is a weekend, Public static Boolean isWeekend(Calendar) {int week = getWeekFormCalendar(Calendar); return week == 0 || week == 6; } public static int getWeekFormCalendar(calendar) public static int getWeekFormCalendar(calendar calendar) { int week = calendar.get(Calendar.DAY_OF_WEEK); return week - 1; Public static int getMonthLastDay () {Calendar a = calendar.getInstance (); a.set(Calendar.DATE, 1); // Set the DATE to the first day of the month a.roll(calendar. DATE, -1); Int maxDate = a.date (calendar.date); return maxDate; } public static int getMonthLastDay(int year, int month) {Calendar a = Calendar. GetInstance (); a.set(Calendar.YEAR, year); a.set(Calendar.MONTH, month); a.set(Calendar.DATE, 1); // Set the DATE to the first day of the month a.roll(calendar. DATE, -1); Int maxDate = a.date (calendar.date); return maxDate; } public static int getFirstDayOfMonthWeek(int year, int month) { Calendar a = Calendar.getInstance(); a.set(Calendar.YEAR, year); a.set(Calendar.MONTH, month); a.set(Calendar.DATE, 1); DAY_OF_WEEK (calendar.day_of_week); // Set the date to the first day of the month. }Copy the code

Share with you

I want to work my way up

Fly forward on the blades at the highest point

Let the wind blow dry tears and sweat

I want to work my way up

Waiting for the sun to watch its face

Little days have big dreams

I have my day

Let the wind blow dry tears and sweat

One day I will have my day