+/* VorlesungsplanUpcomingDayListItem.java
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
package de.dhbwloe.campusapp.fragments;
-
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
}
public String getFormatedDate() {
- SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.");
+ SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_date));
Date date = new Date(cardDate * 1000);
- int weekdayResIds[] = new int[] { R.string.week_saturday, R.string.week_sunday, R.string.week_monday, R.string.week_tuesday, R.string.week_wednesday, R.string.week_thursday, R.string.week_friday };
+ int weekdayResIds[] = new int[] { R.string.week_sunday, R.string.week_monday, R.string.week_tuesday, R.string.week_wednesday, R.string.week_thursday, R.string.week_friday, R.string.week_saturday };
Calendar cal = Calendar.getInstance();
cal.setTime(date);
- int dow = cal.get(Calendar.DAY_OF_WEEK);
+ int dow = cal.get(Calendar.DAY_OF_WEEK)-1;
return CampusAppContext.getInstance().getResString(weekdayResIds[dow]) + ", " + dateFormat.format(date);
}