/** * creates a new Calendar from the Main calendar url: <a href="{@value #CALENDAR_URL}">See * Calendar Url</a> * * @param numDays the number of days to extend from the current day. */ public Unit5Calendar(int numDays) { WestNewsReader westNews = new WestNewsReader( "http://www.unit5.org/site/RSS.aspx?DomainID=30&ModuleInstanceID=1852&PageID=53"); RSSReader unit5News = new RSSReader("http://www.unit5.org/site/RSS.aspx?DomainID=4&ModuleInstanceID=4&PageID=1"); setNewsRssReaders(westNews, unit5News); newsTask = new ReadAllFeedTask(); dates = new CalendarDate[numDays]; String currentDate = Time.getCurrentDate(Time.FORMAT_BASIC_DATE); int currentDateNum = Time.getDateAsNumber(currentDate); String previousDate = currentDate; for (int i = 0; i < dates.length; i++) { if (i == 0) { dates[0] = new CalendarDate(currentDate); } else { currentDate = Time.getDateAfterDate(previousDate); dates[i] = new CalendarDate(currentDate); previousDate = currentDate; } } if (Utils.hadInternetOnLastCheck) { loadCalendar(); } }
/** * creates a new Calendar from the Main calendar url: <a href="{@value #CALENDAR_URL}">See * Calendar Url</a> * * @param numDays the number of days to extend from the current day. * @param loadCalendarImmediately true to load the calendar in the constructor, false to load the * calendar from calling a loadcalendar() function. */ public Unit5Calendar(int numDays, boolean loadCalendarImmediately) { dates = new CalendarDate[numDays]; String currentDate = Time.getCurrentDate(Time.FORMAT_BASIC_DATE); int currentDateNum = Time.getDateAsNumber(currentDate); String previousDate = currentDate; for (int i = 0; i < dates.length; i++) { if (i == 0) { dates[0] = new CalendarDate(currentDate); } else { currentDate = Time.getDateAfterDate(previousDate); dates[i] = new CalendarDate(currentDate); previousDate = currentDate; } } if (loadCalendarImmediately && Utils.hadInternetOnLastCheck) { loadCalendar(); } }
/** * This would combine all of today's info onto one date (events, lunch meals, breakfast meals, * announcements, and anything else. Perhaps we should make an Overall 'CalendarDate' class or * something). */ public void loadTodaysInformation() { String date = Time.getCurrentDate(Time.FORMAT_BASIC_DATE); }