// Path: app/src/ru/bsuirhelper/android/core/StudentCalendar.java
// public class StudentCalendar {
//     private final DateTime mCurrentDateTime;
//     private static int mDaysOfYear = 0;
//     private static int mSemester;
// 
//     public StudentCalendar() {
//         mCurrentDateTime = new DateTime();
//         mDaysOfYear = getDaysOfYear();
// 
//         if (mCurrentDateTime.getMonthOfYear() >= 9) {
//             mSemester = 1;
//         } else {
//             mSemester = 2;
//         }
//     }
// 
//     public int getDayOfYear() {
//         int dayOfYear;
//         if (mCurrentDateTime.getMonthOfYear() >= 9) {
//             DateTime september = new DateTime(mCurrentDateTime.getYear(), 9, 1, 0, 0, 0);
//             dayOfYear = new Interval(september, mCurrentDateTime).toPeriod(PeriodType.days()).getDays();
//         } else {
//             DateTime september = new DateTime(mCurrentDateTime.getYear() - 1, 9, 1, 0, 0, 0);
//             dayOfYear = new Interval(september, mCurrentDateTime).toPeriod(PeriodType.days()).getDays();
//         }
// 
//         return dayOfYear + 1;
//     }
// 
//     public int getDayOfYear(DateTime dateTime) {
//         int dayOfYear;
//         if (dateTime.getMonthOfYear() >= 9) {
//             DateTime september = new DateTime(dateTime.getYear(), 9, 1, 0, 0, 0);
//             dayOfYear = new Interval(september, dateTime).toPeriod(PeriodType.days()).getDays();
//         } else {
//             DateTime september = new DateTime(dateTime.getYear() - 1, 9, 1, 0, 0, 0);
//             dayOfYear = new Interval(september, dateTime).toPeriod(PeriodType.days()).getDays();
//         }
//         return dayOfYear;
//     }
// 
//     public int getDaysOfYear() {
//         if (mDaysOfYear == 0) {
//             DateTime september;
//             DateTime august;
// 
//             if (mCurrentDateTime.getMonthOfYear() <= 8) {
//                 september = new DateTime(mCurrentDateTime.getYear() - 1, 9, 1, 0, 0, 0);
//                 august = new DateTime(mCurrentDateTime.getYear(), 8, 31, 0, 0, 0);
//             } else {
//                 september = new DateTime(mCurrentDateTime.getYear(), 8, 31, 0, 0, 0);
//                 august = new DateTime(mCurrentDateTime.getYear() + 1, 8, 31, 0, 0, 0);
//             }
// 
//             mDaysOfYear = new Interval(september, august).toPeriod(PeriodType.days()).getDays();
//         }
//         return mDaysOfYear;
//     }
// 
//     public static int getWorkWeek(DateTime dateTime) {
//         DateTime september;
// 
//         if (dateTime.getMonthOfYear() <= 8) {
//             september = new DateTime(dateTime.getYear() - 1, 9, 1, 0, 0, 0);
//         } else {
//             september = new DateTime(dateTime.getYear(), 9, 1, 0, 0, 0);
//         }
// 
//         Interval interval = new Interval(september, dateTime);
//         int workWeek = (interval.toPeriod(PeriodType.weeks()).getWeeks() + 2) % 4;
//         workWeek = workWeek == 0 ? 4 : workWeek;
//         return workWeek;
//     }
// 
//     public static DateTime convertToDefaultDateTime(int studentDay) {
//         DateTime september;
//         int currentMonth = DateTime.now().getMonthOfYear();
//         if (currentMonth <= 8) {
//             september = new DateTime(DateTime.now().getYear() - 1, 9, 1, 0, 0, 0);
//         } else {
//             september = new DateTime(DateTime.now().getYear(), 9, 1, 0, 0, 0);
//         }
//         return september.plusDays(studentDay - 1);
//     }
// 
//     public int getSemester() {
//         return mSemester;
//     }
// 
//     public static long getStartStudentYear() {
//         DateTime september;
// 
//         if (DateTime.now().getMonthOfYear() <= 8) {
//             september = new DateTime(DateTime.now().getYear() - 1, 9, 1, 0, 0, 0);
//         } else {
//             september = new DateTime(DateTime.now().getYear(), 8, 31, 1, 0, 0);
//         }
// 
//         return september.getMillis();
//     }
// 
//     public static long getEndStudentYear() {
//         DateTime august;
//         if (DateTime.now().getMonthOfYear() <= 8) {
//             august = new DateTime(DateTime.now().getYear(), 8, 31, 1, 0, 0);
//         } else {
//             august = new DateTime(DateTime.now().getYear() + 1, 8, 31, 1, 0, 0);
//         }
//         return august.getMillis();
//     }
// 
// }


import android.content.Context;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import ru.bsuirhelper.android.core.StudentCalendar;
import java.util.ArrayList;
package ru.bsuirhelper.android.core.schedule;



/**
 * Created by Влад on 12.09.13.
 */
public class ScheduleManager {
    private final ScheduleDatabase mScheduleDatabase;
// Path: app/src/ru/bsuirhelper/android/core/StudentCalendar.java
// public class StudentCalendar {
//     private final DateTime mCurrentDateTime;
//     private static int mDaysOfYear = 0;
//     private static int mSemester;
// 
//     public StudentCalendar() {
//         mCurrentDateTime = new DateTime();
//         mDaysOfYear = getDaysOfYear();
// 
//         if (mCurrentDateTime.getMonthOfYear() >= 9) {
//             mSemester = 1;
//         } else {
//             mSemester = 2;
//         }
//     }
// 
//     public int getDayOfYear() {
//         int dayOfYear;
//         if (mCurrentDateTime.getMonthOfYear() >= 9) {
//             DateTime september = new DateTime(mCurrentDateTime.getYear(), 9, 1, 0, 0, 0);
//             dayOfYear = new Interval(september, mCurrentDateTime).toPeriod(PeriodType.days()).getDays();
//         } else {
//             DateTime september = new DateTime(mCurrentDateTime.getYear() - 1, 9, 1, 0, 0, 0);
//             dayOfYear = new Interval(september, mCurrentDateTime).toPeriod(PeriodType.days()).getDays();
//         }
// 
//         return dayOfYear + 1;
//     }
// 
//     public int getDayOfYear(DateTime dateTime) {
//         int dayOfYear;
//         if (dateTime.getMonthOfYear() >= 9) {
//             DateTime september = new DateTime(dateTime.getYear(), 9, 1, 0, 0, 0);
//             dayOfYear = new Interval(september, dateTime).toPeriod(PeriodType.days()).getDays();
//         } else {
//             DateTime september = new DateTime(dateTime.getYear() - 1, 9, 1, 0, 0, 0);
//             dayOfYear = new Interval(september, dateTime).toPeriod(PeriodType.days()).getDays();
//         }
//         return dayOfYear;
//     }
// 
//     public int getDaysOfYear() {
//         if (mDaysOfYear == 0) {
//             DateTime september;
//             DateTime august;
// 
//             if (mCurrentDateTime.getMonthOfYear() <= 8) {
//                 september = new DateTime(mCurrentDateTime.getYear() - 1, 9, 1, 0, 0, 0);
//                 august = new DateTime(mCurrentDateTime.getYear(), 8, 31, 0, 0, 0);
//             } else {
//                 september = new DateTime(mCurrentDateTime.getYear(), 8, 31, 0, 0, 0);
//                 august = new DateTime(mCurrentDateTime.getYear() + 1, 8, 31, 0, 0, 0);
//             }
// 
//             mDaysOfYear = new Interval(september, august).toPeriod(PeriodType.days()).getDays();
//         }
//         return mDaysOfYear;
//     }
// 
//     public static int getWorkWeek(DateTime dateTime) {
//         DateTime september;
// 
//         if (dateTime.getMonthOfYear() <= 8) {
//             september = new DateTime(dateTime.getYear() - 1, 9, 1, 0, 0, 0);
//         } else {
//             september = new DateTime(dateTime.getYear(), 9, 1, 0, 0, 0);
//         }
// 
//         Interval interval = new Interval(september, dateTime);
//         int workWeek = (interval.toPeriod(PeriodType.weeks()).getWeeks() + 2) % 4;
//         workWeek = workWeek == 0 ? 4 : workWeek;
//         return workWeek;
//     }
// 
//     public static DateTime convertToDefaultDateTime(int studentDay) {
//         DateTime september;
//         int currentMonth = DateTime.now().getMonthOfYear();
//         if (currentMonth <= 8) {
//             september = new DateTime(DateTime.now().getYear() - 1, 9, 1, 0, 0, 0);
//         } else {
//             september = new DateTime(DateTime.now().getYear(), 9, 1, 0, 0, 0);
//         }
//         return september.plusDays(studentDay - 1);
//     }
// 
//     public int getSemester() {
//         return mSemester;
//     }
// 
//     public static long getStartStudentYear() {
//         DateTime september;
// 
//         if (DateTime.now().getMonthOfYear() <= 8) {
//             september = new DateTime(DateTime.now().getYear() - 1, 9, 1, 0, 0, 0);
//         } else {
//             september = new DateTime(DateTime.now().getYear(), 8, 31, 1, 0, 0);
//         }
// 
//         return september.getMillis();
//     }
// 
//     public static long getEndStudentYear() {
//         DateTime august;
//         if (DateTime.now().getMonthOfYear() <= 8) {
//             august = new DateTime(DateTime.now().getYear(), 8, 31, 1, 0, 0);
//         } else {
//             august = new DateTime(DateTime.now().getYear() + 1, 8, 31, 1, 0, 0);
//         }
//         return august.getMillis();
//     }
// 
// }


// Path: app/src/ru/bsuirhelper/android/core/schedule/ScheduleManager.java
import android.content.Context;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import ru.bsuirhelper.android.core.StudentCalendar;
import java.util.ArrayList;

package ru.bsuirhelper.android.core.schedule;



/**
 * Created by Влад on 12.09.13.
 */
public class ScheduleManager {
    private final ScheduleDatabase mScheduleDatabase;
    private StudentCalendar mStudentCalendar = new StudentCalendar();