Back to project page calendar-widget.
The source code is released under:
Apache License
If you think the Android project calendar-widget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.plusonelabs.calendar.model; /*from w ww . jav a 2s. com*/ import org.joda.time.DateTime; public class Event implements Comparable<Event> { private DateTime startDate; public DateTime getStartDate() { return startDate; } public void setStartDate(DateTime startDate) { this.startDate = startDate; } public boolean isSameDay(DateTime otherDate) { return startDate.withTimeAtStartOfDay().isEqual(otherDate.withTimeAtStartOfDay()); } public boolean isToday() { return isSameDay(new DateTime()); } public boolean isTomorrow() { return isSameDay(new DateTime().plusDays(1)); } @Override public String toString() { return "CalenderEntry [startDate=" + startDate + "]"; } @Override public int compareTo(Event otherEvent) { if (getStartDate().isAfter(otherEvent.getStartDate())) { return 1; } else if (getStartDate().isBefore(otherEvent.getStartDate())) { return -1; } return 0; } }