// Path: src/main/java/org/openbakery/timetracker/util/DateHelper.java
// public class DateHelper {
// 
// 	private static final Logger log = LoggerFactory.getLogger(DateHelper.class);
// 	// TODO move resource bundle
// 	public static final String TIME_PATTERN = "HH:mm";
// 	public static final String DATE_PATTERN = "dd.MM.yyyy";
// 	public static final String DATE_PATTERN_WITH_DAYNAME = "EEE dd.MM.yyyy";
// 	private static final int INTERVAL = 15;
// 
// 	public static Date setTimeForDate(Date currentDay, Date currentTime) {
// 		DateTime currentDate = new DateTime(currentDay.getTime());
// 		MutableDateTime dateTime = new MutableDateTime(currentTime);
// 		dateTime.setYear(currentDate.getYear());
// 		dateTime.setMonthOfYear(currentDate.getMonthOfYear());
// 		dateTime.setDayOfYear(currentDate.getDayOfYear());
// 		return dateTime.toDate();
// 	}
// 
// 
// 	public static DateTime trimDateTime(DateTime dateTime) {
// 		log.debug("before trim: {}", dateTime);
// 
// 		MutableDateTime mutableDateTime = dateTime.toMutableDateTime();
// 		mutableDateTime.setMinuteOfHour((mutableDateTime.getMinuteOfHour() / INTERVAL) * INTERVAL);
// 		mutableDateTime.setSecondOfMinute(0);
// 		mutableDateTime.setMillisOfSecond(0);
// 		dateTime = mutableDateTime.toDateTime();
// 
// 		log.debug("after trim: {}", dateTime);
// 		return dateTime;
// 
// 	}
// 
// 	public static Date trimDateTime(Date date) {
// 		return trimDateTime(new DateTime(date.getTime())).toDate();
// 	}
// }
// 
// Path: src/main/java/org/openbakery/timetracker/util/DurationHelper.java
// public class DurationHelper {
// 
// 	private static Logger log = LoggerFactory.getLogger(DurationHelper.class);
// 
// 
// 	public static Duration calculateDurationSum(List<TimeEntry> timeEntryList) {
// 		Duration sum = Duration.ZERO;
// 
// 		for (TimeEntry entry : timeEntryList) {
// 			sum = sum.plus(entry.getDuration());
// 			log.debug("add {}, sum {}", entry.getDuration(), sum);
// 		}
// 		return sum;
// 	}
// 
// 	public static String toTimeString(Duration duration) {
// 		Period period = duration.toPeriod();
// 		return period.getHours() + "," + period.getMinutes()*100/60;
// 	}
// 
// 	public static double toTime(Duration duration) {
// 		Period period = duration.toPeriod();
// 		return period.getHours() +  period.getMinutes()/60.0;
// 	}
// 
// }


import org.apache.commons.lang.time.DateUtils;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.openbakery.timetracker.util.DateHelper;
import org.openbakery.timetracker.util.DurationHelper;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
package org.openbakery.timetracker.web.timesheet;



/**
 * Created with IntelliJ IDEA.
 * User: rene
 * Date: 25.02.13
 * Time: 17:00
 * To change this template use File | Settings | File Templates.
 */
public class DayEntryListView extends ListView<DayEntry> {

	private static final long serialVersionUID = 1L;

// Path: src/main/java/org/openbakery/timetracker/util/DateHelper.java
// public class DateHelper {
// 
// 	private static final Logger log = LoggerFactory.getLogger(DateHelper.class);
// 	// TODO move resource bundle
// 	public static final String TIME_PATTERN = "HH:mm";
// 	public static final String DATE_PATTERN = "dd.MM.yyyy";
// 	public static final String DATE_PATTERN_WITH_DAYNAME = "EEE dd.MM.yyyy";
// 	private static final int INTERVAL = 15;
// 
// 	public static Date setTimeForDate(Date currentDay, Date currentTime) {
// 		DateTime currentDate = new DateTime(currentDay.getTime());
// 		MutableDateTime dateTime = new MutableDateTime(currentTime);
// 		dateTime.setYear(currentDate.getYear());
// 		dateTime.setMonthOfYear(currentDate.getMonthOfYear());
// 		dateTime.setDayOfYear(currentDate.getDayOfYear());
// 		return dateTime.toDate();
// 	}
// 
// 
// 	public static DateTime trimDateTime(DateTime dateTime) {
// 		log.debug("before trim: {}", dateTime);
// 
// 		MutableDateTime mutableDateTime = dateTime.toMutableDateTime();
// 		mutableDateTime.setMinuteOfHour((mutableDateTime.getMinuteOfHour() / INTERVAL) * INTERVAL);
// 		mutableDateTime.setSecondOfMinute(0);
// 		mutableDateTime.setMillisOfSecond(0);
// 		dateTime = mutableDateTime.toDateTime();
// 
// 		log.debug("after trim: {}", dateTime);
// 		return dateTime;
// 
// 	}
// 
// 	public static Date trimDateTime(Date date) {
// 		return trimDateTime(new DateTime(date.getTime())).toDate();
// 	}
// }
// 
// Path: src/main/java/org/openbakery/timetracker/util/DurationHelper.java
// public class DurationHelper {
// 
// 	private static Logger log = LoggerFactory.getLogger(DurationHelper.class);
// 
// 
// 	public static Duration calculateDurationSum(List<TimeEntry> timeEntryList) {
// 		Duration sum = Duration.ZERO;
// 
// 		for (TimeEntry entry : timeEntryList) {
// 			sum = sum.plus(entry.getDuration());
// 			log.debug("add {}, sum {}", entry.getDuration(), sum);
// 		}
// 		return sum;
// 	}
// 
// 	public static String toTimeString(Duration duration) {
// 		Period period = duration.toPeriod();
// 		return period.getHours() + "," + period.getMinutes()*100/60;
// 	}
// 
// 	public static double toTime(Duration duration) {
// 		Period period = duration.toPeriod();
// 		return period.getHours() +  period.getMinutes()/60.0;
// 	}
// 
// }


// Path: src/main/java/org/openbakery/timetracker/web/timesheet/DayEntryListView.java
import org.apache.commons.lang.time.DateUtils;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.openbakery.timetracker.util.DateHelper;
import org.openbakery.timetracker.util.DurationHelper;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

package org.openbakery.timetracker.web.timesheet;



/**
 * Created with IntelliJ IDEA.
 * User: rene
 * Date: 25.02.13
 * Time: 17:00
 * To change this template use File | Settings | File Templates.
 */
public class DayEntryListView extends ListView<DayEntry> {

	private static final long serialVersionUID = 1L;

	private static final SimpleDateFormat dateFormat = new SimpleDateFormat(DateHelper.DATE_PATTERN_WITH_DAYNAME);