ui: Change the default date range to be last week

In a future CL, this will let us use the default range for the initial
query.

BUG=chromium:685424
TEST=Local afe manual testing.

Change-Id: Ic589db689cce7e64240cd3a0612376cb73c50112
Reviewed-on: https://chromium-review.googlesource.com/461356
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
diff --git a/frontend/client/src/autotest/common/table/DatetimeSegmentFilter.java b/frontend/client/src/autotest/common/table/DatetimeSegmentFilter.java
index 275dab8..9b533c1 100644
--- a/frontend/client/src/autotest/common/table/DatetimeSegmentFilter.java
+++ b/frontend/client/src/autotest/common/table/DatetimeSegmentFilter.java
@@ -8,6 +8,7 @@
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.Panel;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.datepicker.client.CalendarUtil;
 
 import java.util.Date;
 
@@ -17,7 +18,8 @@
     protected Panel panel;
     protected Label fromLabel;
     protected Label toLabel;
-    private String placeHolderDatetime;
+    private String placeHolderStartDatetime;
+    private String placeHolderEndDatetime;
 
     public DatetimeSegmentFilter() {
         startDatetimeBox = new DateTimeBox();
@@ -32,9 +34,13 @@
         panel.add(endDatetimeBox);
 
         DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat("yyyy-MM-dd");
-        placeHolderDatetime = dateTimeFormat.format(new Date()) + "T00:00";
-        setStartTimeToPlaceHolderValue();
+        Date placeHolderDate = new Date();
+        placeHolderEndDatetime = dateTimeFormat.format(placeHolderDate) + "T00:00";
         setEndTimeToPlaceHolderValue();
+
+        CalendarUtil.addDaysToDate(placeHolderDate, -7);
+        placeHolderStartDatetime = dateTimeFormat.format(placeHolderDate) + "T00:00";
+        setStartTimeToPlaceHolderValue();
     }
 
     @Override
@@ -43,11 +49,11 @@
     }
 
     public void setStartTimeToPlaceHolderValue() {
-        startDatetimeBox.setValue(placeHolderDatetime);
+        startDatetimeBox.setValue(placeHolderStartDatetime);
     }
 
     public void setEndTimeToPlaceHolderValue() {
-        endDatetimeBox.setValue(placeHolderDatetime);
+        endDatetimeBox.setValue(placeHolderEndDatetime);
     }
 
     public void addValueChangeHandler(ValueChangeHandler<String> startTimeHandler,
@@ -55,4 +61,4 @@
         startDatetimeBox.addValueChangeHandler(startTimeHandler);
         endDatetimeBox.addValueChangeHandler(endTimeHandler);
     }
-}
\ No newline at end of file
+}