package edu.deanza.calendar.models;

import org.joda.time.LocalTime;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Sara on 5/28/2016.
 */
public class Event {

    protected String name, description, location;
    protected LocalTime startTime, endTime;

    // TODO: implement `categories` field

    public Event() {}

    public Event(String name, String description, String location, String startTime,
                 String endTime) {
        this.name = name;
        this.description = description;
        this.location = location;
        this.startTime = LocalTime.parse(startTime);
        this.endTime = LocalTime.parse(endTime);

    }

    public static Event fromJson(JSONObject eventJson) {
        Event e = new Event();
        try {
            e.name = eventJson.getString("name");
            e.description = eventJson.getString("description");
            e.location = eventJson.getString("location");
            e.startTime = LocalTime.parse(eventJson.getString("start_time"));
            e.endTime = LocalTime.parse(eventJson.getString("end_time"));
        }
        catch (JSONException ex) {
            ex.printStackTrace();
            return null;
        }
        return e;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public String getLocation() {
        return location;
    }

    public LocalTime getStartTime() {
        return startTime;
    }

    public LocalTime getEndTime() {
        return endTime;
    }

}
@@ -51,21 +51,20 @@
 da.time.
-Local
+Date
 Time;%0Aim
@@ -248,21 +248,20 @@
 otected 
-Local
+Date
 Time sta
@@ -581,37 +581,36 @@
 his.startTime = 
-Local
+Date
 Time.parse(start
@@ -631,37 +631,36 @@
  this.endTime = 
-Local
+Date
 Time.parse(endTi
@@ -968,29 +968,28 @@
 startTime = 
-Local
+Date
 Time.parse(e
@@ -1047,21 +1047,20 @@
 dTime = 
-Local
+Date
 Time.par
@@ -1434,37 +1434,36 @@
   %7D%0A%0A    public 
-Local
+Date
 Time getStartTim
@@ -1516,13 +1516,12 @@
 lic 
-Local
+Date
 Time

Use DateTime so that Interval s can be compared easily