use of hirondelle.date4j.DateTime in project instructure-android by instructure.
the class CalendarListViewFragment method todayClick.
// /////////////////////////////////////////////////////
// Overflow menu helper methods //
// /////////////////////////////////////////////////////
private void todayClick() {
mRecyclerAdapter.setTodayPressed(true);
DateTime today = DateTime.today(TimeZone.getDefault());
mRecyclerAdapter.setSelectedDay(today);
mCalendarFragment.moveToDateTime(today);
mRecyclerAdapter.refreshForTodayPressed();
if (mCalendarContainer.getVisibility() == View.GONE) {
expandOrCollapseCalendar(mCalendarContainer, true);
}
}
use of hirondelle.date4j.DateTime in project instructure-android by instructure.
the class CaldroidFragment method setDisableDatesFromString.
/**
* Set disableDates from ArrayList of String with custom date format. For
* example, if the date string is 06-Jan-2013, use date format dd-MMM-yyyy.
* This method will refresh the calendar, it's not necessary to call
* refreshView()
*
* @param disableDateStrings
* @param dateFormat
*/
public void setDisableDatesFromString(ArrayList<String> disableDateStrings, String dateFormat) {
if (disableDateStrings == null) {
return;
}
disableDates.clear();
for (String dateString : disableDateStrings) {
DateTime dateTime = CalendarHelper.getDateTimeFromString(dateString, dateFormat);
disableDates.add(dateTime);
}
}
use of hirondelle.date4j.DateTime in project instructure-android by instructure.
the class CaldroidFragment method getDaysOfWeek.
/**
* To display the week day title
*
* @return "SUN, MON, TUE, WED, THU, FRI, SAT"
*/
protected ArrayList<String> getDaysOfWeek() {
ArrayList<String> list = new ArrayList<String>();
SimpleDateFormat fmt = DateHelper.getShortDayFormat();
// 17 Feb 2013 is Sunday
DateTime sunday = new DateTime(2013, 2, 17, 0, 0, 0, 0);
DateTime nextDay = sunday.plusDays(startDayOfWeek - SUNDAY);
for (int i = 0; i < 7; i++) {
Date date = CalendarHelper.convertDateTimeToDate(nextDay);
list.add(fmt.format(date).toUpperCase());
nextDay = nextDay.plusDays(1);
}
return list;
}
use of hirondelle.date4j.DateTime in project instructure-android by instructure.
the class CaldroidFragment method setBackgroundResourceForDates.
/**
* Set backgroundForDateMap
*/
public void setBackgroundResourceForDates(HashMap<Date, Integer> backgroundForDateMap) {
if (backgroundForDateMap == null || backgroundForDateMap.size() == 0) {
return;
}
backgroundForDateTimeMap.clear();
for (Date date : backgroundForDateMap.keySet()) {
Integer resource = backgroundForDateMap.get(date);
DateTime dateTime = CalendarHelper.convertDateToDateTime(date);
backgroundForDateTimeMap.put(dateTime, resource);
}
}
use of hirondelle.date4j.DateTime in project instructure-android by instructure.
the class CaldroidFragment method setTextColorForDates.
/**
* Set textColorForDateMap
*
* @return
*/
public void setTextColorForDates(HashMap<Date, Integer> textColorForDateMap) {
if (textColorForDateMap == null || textColorForDateMap.size() == 0) {
return;
}
textColorForDateTimeMap.clear();
for (Date date : textColorForDateMap.keySet()) {
Integer resource = textColorForDateMap.get(date);
DateTime dateTime = CalendarHelper.convertDateToDateTime(date);
textColorForDateTimeMap.put(dateTime, resource);
}
}
Aggregations