diff --git a/src/com/android/contacts/common/list/ContactEntryListFragment.java b/src/com/android/contacts/common/list/ContactEntryListFragment.java
index b1edc59..8543da3 100644
--- a/src/com/android/contacts/common/list/ContactEntryListFragment.java
+++ b/src/com/android/contacts/common/list/ContactEntryListFragment.java
@@ -95,6 +95,7 @@
     private boolean mIncludeProfile;
     private boolean mSearchMode;
     private boolean mVisibleScrollbarEnabled;
+    private boolean mShowEmptyListForEmptyQuery;
     private int mVerticalScrollbarPosition = getDefaultVerticalScrollbarPosition();
     private String mQueryString;
     private int mDirectorySearchMode = DirectoryListLoader.SEARCH_MODE_NONE;
@@ -560,9 +561,8 @@
     }
 
     /**
-     * Enter/exit search mode.  By design, a fragment enters search mode only when it has a
-     * non-empty query text, so the mode must be tightly related to the current query.
-     * For this reason this method must only be called by {@link #setQueryString}.
+     * Enter/exit search mode. This is method is tightly related to the current query, and should
+     * only be called by {@link #setQueryString}.
      *
      * Also note this method doesn't call {@link #reloadData()}; {@link #setQueryString} does it.
      */
@@ -605,12 +605,19 @@
     }
 
     public void setQueryString(String queryString, boolean delaySelection) {
-        // Normalize the empty query.
-        if (TextUtils.isEmpty(queryString)) queryString = null;
-
         if (!TextUtils.equals(mQueryString, queryString)) {
+            if (mShowEmptyListForEmptyQuery && mAdapter != null && mListView != null) {
+                if (TextUtils.isEmpty(mQueryString)) {
+                    // Restore the adapter if the query used to be empty.
+                    mListView.setAdapter(mAdapter);
+                } else if (TextUtils.isEmpty(queryString)) {
+                    // Instantly clear the list view if the new query is empty.
+                    mListView.setAdapter(null);
+                }
+            }
+
             mQueryString = queryString;
-            setSearchMode(!TextUtils.isEmpty(mQueryString));
+            setSearchMode(!TextUtils.isEmpty(mQueryString) || mShowEmptyListForEmptyQuery);
 
             if (mAdapter != null) {
                 mAdapter.setQueryString(queryString);
@@ -619,6 +626,10 @@
         }
     }
 
+    public void setShowEmptyListForNullQuery(boolean show) {
+        mShowEmptyListForEmptyQuery = show;
+    }
+
     public int getDirectoryLoaderId() {
         return DIRECTORY_LOADER_ID;
     }
diff --git a/src/com/android/contacts/common/util/DateUtils.java b/src/com/android/contacts/common/util/DateUtils.java
index f527eb9..5d8ba70 100644
--- a/src/com/android/contacts/common/util/DateUtils.java
+++ b/src/com/android/contacts/common/util/DateUtils.java
@@ -18,6 +18,7 @@
 
 import android.content.Context;
 import android.text.format.DateFormat;
+import android.text.format.Time;
 
 
 import java.text.ParsePosition;
@@ -268,4 +269,51 @@
         }
         return anniversary.getTime();
     }
+
+    /**
+     * Retrieves a locale-specific string for "Today".
+     *
+     * @return Locale-specific string for "Today".
+     */
+    public static CharSequence getTodayString() {
+       return android.text.format.DateUtils.getRelativeTimeSpanString(
+               -android.text.format.DateUtils.HOUR_IN_MILLIS,
+               0,
+               android.text.format.DateUtils.DAY_IN_MILLIS,
+               android.text.format.DateUtils.FORMAT_ABBREV_RELATIVE);
+
+    }
+
+    /**
+     * Retrieves a locale-specific string for "Yesterday".
+     *
+     * @return Locale-specific string for "Yesterday".
+     */
+    public static CharSequence getYesterdayString() {
+        return android.text.format.DateUtils.getRelativeTimeSpanString(
+                -android.text.format.DateUtils.DAY_IN_MILLIS,
+                0,
+                android.text.format.DateUtils.DAY_IN_MILLIS,
+                android.text.format.DateUtils.FORMAT_ABBREV_RELATIVE);
+
+    }
+
+    /**
+     * Determine the difference, in days between two dates.  Uses similar logic as the
+     * {@link android.text.format.DateUtils.getRelativeTimeSpanString} method.
+     *
+     * @param time Instance of time object to use for calculations.
+     * @param date1 First date to check.
+     * @param date2 Second date to check.
+     * @return The absolute difference in days between the two dates.
+     */
+    public static int getDayDifference(Time time, long date1, long date2) {
+        time.set(date1);
+        int startDay = Time.getJulianDay(date1, time.gmtoff);
+
+        time.set(date2);
+        int currentDay = Time.getJulianDay(date2, time.gmtoff);
+
+        return Math.abs(currentDay - startDay);
+    }
 }
diff --git a/tests/src/com/android/contacts/common/util/DateUtilTests.java b/tests/src/com/android/contacts/common/util/DateUtilTests.java
new file mode 100644
index 0000000..c225780
--- /dev/null
+++ b/tests/src/com/android/contacts/common/util/DateUtilTests.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.contacts.common.util;
+
+import junit.framework.TestCase;
+
+import android.test.suitebuilder.annotation.SmallTest;
+import android.text.format.Time;
+
+/**
+ * Unit tests for {@link com.android.contacts.common.util.DateUtils}.
+ */
+@SmallTest
+public class DateUtilTests extends TestCase {
+
+    /**
+     * Test ability to get the word "Yesterday".
+     */
+    public void testGetYesterday() {
+        assertEquals("Yesterday", DateUtils.getYesterdayString());
+    }
+
+    /**
+     * Test ability to get the word "Today".
+     */
+    public void testGetToday() {
+        assertEquals("Yesterday", DateUtils.getYesterdayString());
+    }
+
+    /**
+     * Test date differences which are in the same day.
+     */
+    public void testDayDiffNone() {
+        Time time = new Time();
+        long date1 = System.currentTimeMillis();
+        long date2 = System.currentTimeMillis() + android.text.format.DateUtils.HOUR_IN_MILLIS;
+        assertEquals(0, DateUtils.getDayDifference(time, date1, date2));
+        assertEquals(0, DateUtils.getDayDifference(time, date2, date1));
+    }
+
+    /**
+     * Test date differences which are a day apart.
+     */
+    public void testDayDiffOne() {
+        Time time = new Time();
+        long date1 = System.currentTimeMillis();
+        long date2 = date1 + android.text.format.DateUtils.DAY_IN_MILLIS;
+        assertEquals(1, DateUtils.getDayDifference(time, date1, date2));
+        assertEquals(1, DateUtils.getDayDifference(time, date2, date1));
+    }
+
+    /**
+     * Test date differences which are two days apart.
+     */
+    public void testDayDiffTwo() {
+        Time time = new Time();
+        long date1 = System.currentTimeMillis();
+        long date2 = date1 + 2*android.text.format.DateUtils.DAY_IN_MILLIS;
+        assertEquals(2, DateUtils.getDayDifference(time, date1, date2));
+        assertEquals(2, DateUtils.getDayDifference(time, date2, date1));
+    }
+}
