bug fixed

set initial shareTime to two hrs from current Time
This commit is contained in:
Mark Wittpoth
2018-01-22 20:51:34 +01:00
parent 4bcecdc4c1
commit c0541df995
@@ -97,8 +97,10 @@ public class ShareFragment extends AbstractFragment {
getCurrentDate();
endDateTextView.setText(getApp().getDateFormat().format(calendar.getTime()));
endTimeTextView.setText(getApp().getTimeFormat().format(calendar.getTime()));
Calendar currentPlusTwo = Calendar.getInstance();
currentPlusTwo.setTimeInMillis(currentPlusTwo.getTimeInMillis() + (2*3600000));
endDateTextView.setText(getApp().getDateFormat().format(currentPlusTwo.getTime()));
endTimeTextView.setText(getApp().getTimeFormat().format(currentPlusTwo.getTime()));
friendsButton.setOnClickListener(new View.OnClickListener() {
@@ -149,10 +151,7 @@ public class ShareFragment extends AbstractFragment {
try {
Date tmpDate = getApp().getDateFormat().parse(endDateTextView.getText().toString());
Date tmpTime = getApp().getTimeFormat().parse(endTimeTextView.getText().toString());
//TODO: Hier geht eine Stunde verloren
endDate.setTime(new Date(tmpDate.getTime() + tmpTime.getTime()));
System.out.println(getApp().getDateTimeFormat().format(endDate.getTime()));
endDate.setTime(new Date(tmpDate.getTime() + tmpTime.getTime() + endDate.getTimeZone().getRawOffset()));
outputDate = endDate.getTimeInMillis();
} catch (ParseException e){
e.printStackTrace();