// Path: app/src/main/java/com/zhenghuiyan/todaything/data/ScheduleContract.java
// public final class ScheduleContract {
// 
//     public ScheduleContract() {}
// 
//     public static abstract class ScheduleContractEntry implements BaseColumns {
//         public static final String TABLE_NAME = "Schedule";
// 
//         public static final String COLUMN_NAME_ID = "id";
// 
//         public static final String COLUMN_NAME_STIME = "s_time";
// 
//         public static final String COLUMN_NAME_CONTENT = "content";
// 
//         public static final String COLUMN_NAME_FROM_TIME = "from_time";
// 
//         public static final String COLUMN_NAME_TO_TIME = "to_time";
// 
//         public static final String COLUMN_NAME_COMPLETE_DATE = "complete_date";
// 
//         public static final String COLUMN_NAME_THING_ID = "thing_id";
// 
//         public static final String COLUMN_NAME_WEEK_NUM = "week_num";
// 
//         public static final String DEFAULT_DATE = "2000-01-01";
// 
// 
//     }
// }
// 
// Path: app/src/main/java/com/zhenghuiyan/todaything/util/DateUtil.java
// public class DateUtil {
//     public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
// 
//     private DateUtil() {}
// 
//     public static String dateToString(Date d) {
//         return dateFormat.format(d);
//     }
// 
//     public static Date parseDate(String s) {
//         try {
//             return dateFormat.parse(s);
//         } catch (ParseException e) {
//             e.printStackTrace();
//         }
// 
//         return null;
//     }
// 
//     public static int getDayOfWeek(Date date) {
//         if (date == null) {
//             return -1;
//         }
//         Calendar c = Calendar.getInstance();
//         c.setTime(date);
// 
//         return c.get(Calendar.DAY_OF_WEEK);
//     }
// }


import com.zhenghuiyan.todaything.data.ScheduleContract;
import com.zhenghuiyan.todaything.util.DateUtil;
import java.io.Serializable;
import java.util.Date;
    private int weekNum = 0;
    //binary num of sunday to saturday
    private final int SUN_NUM = 0b00000001;
    private final int MON_NUM = 0b00000010;
    private final int TUE_NUM = 0b00000100;
    private final int WED_NUM = 0b00001000;
    private final int THU_NUM = 0b00010000;
    private final int FRI_NUM = 0b00100000;
    private final int SAT_NUM = 0b01000000;

    public Thing() {}

    public Thing(int id, String sTime, String content, HourAndMinute fromTime, HourAndMinute toTime, int thing_id, String complete_date, int weekNumber) {
        this.id = id;
        this.sTime = sTime;
        this.content = content;
        this.fromTime = fromTime;
        this.toTime = toTime;
        this.thing_id = thing_id;
        this.complete_date = complete_date;
        this.weekNum = weekNumber;
    }

    public Thing(int id, String sTime, String content, String fromTime, String toTime, int thing_id, String complete_date, int weekNumber) {
        this(id, sTime, content, new HourAndMinute(fromTime), new HourAndMinute(toTime), thing_id, complete_date, weekNumber);
    }

    public static boolean isTodayRepeatByWeekNum(int weekNum) {
        Thing t = new Thing();
        t.setWeekNum(weekNum);
// Path: app/src/main/java/com/zhenghuiyan/todaything/data/ScheduleContract.java
// public final class ScheduleContract {
// 
//     public ScheduleContract() {}
// 
//     public static abstract class ScheduleContractEntry implements BaseColumns {
//         public static final String TABLE_NAME = "Schedule";
// 
//         public static final String COLUMN_NAME_ID = "id";
// 
//         public static final String COLUMN_NAME_STIME = "s_time";
// 
//         public static final String COLUMN_NAME_CONTENT = "content";
// 
//         public static final String COLUMN_NAME_FROM_TIME = "from_time";
// 
//         public static final String COLUMN_NAME_TO_TIME = "to_time";
// 
//         public static final String COLUMN_NAME_COMPLETE_DATE = "complete_date";
// 
//         public static final String COLUMN_NAME_THING_ID = "thing_id";
// 
//         public static final String COLUMN_NAME_WEEK_NUM = "week_num";
// 
//         public static final String DEFAULT_DATE = "2000-01-01";
// 
// 
//     }
// }
// 
// Path: app/src/main/java/com/zhenghuiyan/todaything/util/DateUtil.java
// public class DateUtil {
//     public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
// 
//     private DateUtil() {}
// 
//     public static String dateToString(Date d) {
//         return dateFormat.format(d);
//     }
// 
//     public static Date parseDate(String s) {
//         try {
//             return dateFormat.parse(s);
//         } catch (ParseException e) {
//             e.printStackTrace();
//         }
// 
//         return null;
//     }
// 
//     public static int getDayOfWeek(Date date) {
//         if (date == null) {
//             return -1;
//         }
//         Calendar c = Calendar.getInstance();
//         c.setTime(date);
// 
//         return c.get(Calendar.DAY_OF_WEEK);
//     }
// }


// Path: app/src/main/java/com/zhenghuiyan/todaything/bean/Thing.java
import com.zhenghuiyan.todaything.data.ScheduleContract;
import com.zhenghuiyan.todaything.util.DateUtil;
import java.io.Serializable;
import java.util.Date;

    private int weekNum = 0;
    //binary num of sunday to saturday
    private final int SUN_NUM = 0b00000001;
    private final int MON_NUM = 0b00000010;
    private final int TUE_NUM = 0b00000100;
    private final int WED_NUM = 0b00001000;
    private final int THU_NUM = 0b00010000;
    private final int FRI_NUM = 0b00100000;
    private final int SAT_NUM = 0b01000000;

    public Thing() {}

    public Thing(int id, String sTime, String content, HourAndMinute fromTime, HourAndMinute toTime, int thing_id, String complete_date, int weekNumber) {
        this.id = id;
        this.sTime = sTime;
        this.content = content;
        this.fromTime = fromTime;
        this.toTime = toTime;
        this.thing_id = thing_id;
        this.complete_date = complete_date;
        this.weekNum = weekNumber;
    }

    public Thing(int id, String sTime, String content, String fromTime, String toTime, int thing_id, String complete_date, int weekNumber) {
        this(id, sTime, content, new HourAndMinute(fromTime), new HourAndMinute(toTime), thing_id, complete_date, weekNumber);
    }

    public static boolean isTodayRepeatByWeekNum(int weekNum) {
        Thing t = new Thing();
        t.setWeekNum(weekNum);
        int dayOfWeek = DateUtil.getDayOfWeek(new Date());