//strs 周集合,例如 一、二、三、四、五、六
public static boolean isWeek(String strs){ Calendar calendar = Calendar.getInstance(); int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); String week = ""; Boolean is = false; switch (dayOfWeek) { case Calendar.MONDAY: week = "一"; break; case Calendar.TUESDAY: week = "二"; break; case Calendar.WEDNESDAY: week = "三"; break; case Calendar.THURSDAY: week = "四"; break; case Calendar.FRIDAY: week = "五"; break; case Calendar.SATURDAY: week = "六"; break; case Calendar.SUNDAY: week = "日"; break; } List<String> list =Arrays.asList(strs.split(",")); for (int i = 0;i < list.size();i++){ if(list.get(i).equals(week)){ is = true; } } return is; }
标签:week,case,判断,之内,strs,list,break,日期,Calendar From: https://www.cnblogs.com/-llf/p/17976941