package nerd.tuxmobil.fahrplan.congress;

import java.util.ArrayList;
import java.util.HashMap;
import android.app.Application;
import android.util.Log;
import android.util.SparseIntArray;

public class MyApp extends Application {
	public static Application app = null;
	public static boolean DEBUG = false;
	public static ArrayList<Lecture> lectureList = null;
	public static int numdays;
	public static String version;
	public static String title;
	public static String subtitle;
	public static DateInfos dateInfos = null;
	public static FetchFahrplan fetcher = null;
	public static FahrplanParser parser = null;
	public static String schedulePath = "/congress/2013/Fahrplan/schedule.xml";
	// Ruby: Date.new(2013,12,27).to_time.to_i
	public static long first_day_start = 1388098800000l;
	// Ruby: Date.new(2013,12,31).to_time.to_i
	public static long last_day_end = 1388444400000l;
	public static int room_count = 0;
	public static HashMap<String, Integer> roomsMap = new HashMap<String, Integer>();

	enum TASKS {
		NONE,
		FETCH,
		PARSE,
		FETCH_CANCELLED
	}

	// requestCodes für startActivityForResult
	final public static int ALARMLIST = 1;
	final public static int EVENTVIEW = 2;

	public static TASKS task_running = TASKS.NONE;
	public static String fahrplan_xml;
	public static int lectureListDay = 0;
	public static int dayChangeHour;
	public static int dayChangeMinute;
	public static String eTag;
	public static SparseIntArray roomList = new SparseIntArray();

    @Override
    public void onCreate() {
        super.onCreate();
        app = this;
        task_running = TASKS.NONE;
        lectureList = null;
    }

	public static void LogDebug(String tag, String message) {
		if (DEBUG == true) {
			Log.d(tag, message);
		}
	}
}

@@ -84,16 +84,107 @@
 til.
-HashMap;
+Calendar;%0Aimport java.util.GregorianCalendar;%0Aimport java.util.HashMap;%0Aimport java.util.TimeZone;%0A
 %0Aimp
@@ -780,52 +780,8 @@
 l%22;%0A
-%09// Ruby: Date.new(2013,12,27).to_time.to_i%0A
 %09pub
@@ -818,67 +818,54 @@
 t = 
-1388098800000l;%0A%09// Ruby: Date.new(
+getMilliseconds(%22Europe/Paris%22, 
 2013,
+ 
 12,
-31).to_time.to_i
+ 27);
 %0A%09pu
@@ -900,22 +900,53 @@
 d = 
-1388444400000l
+getMilliseconds(%22Europe/Paris%22, 2013, 12, 31)
 ;%0A%09p
@@ -1658,16 +1658,16 @@
 S.NONE;%0A
-
         
@@ -1693,16 +1693,414 @@
 %0A    %7D%0A%0A
+    private static long getMilliseconds(String timeZoneId, int year, int month, int day) %7B%0A    %09TimeZone zone = TimeZone.getTimeZone(timeZoneId);%0A        Calendar calendar = new GregorianCalendar(zone);%0A        int zeroBasedMonth = month - 1;%0A        calendar.set(year, zeroBasedMonth, day, 0, 0, 0);%0A        calendar.set(Calendar.MILLISECOND, 0);%0A        return calendar.getTimeInMillis();%0A    %7D%0A%0A
 %09public 

Increase maintainability for date range assignment.