code: function createDateAtMidnight(opt_value) {
        var date;
        if (angular.isUndefined(opt_value)) {
          date = new Date();
        } else {
          date = new Date(opt_value);
        }
        setDateTimeToMidnight(date);
        return date;
      }
docs: Creates a date with the time set to midnight.
  Drop-in replacement for two forms of the Date constructor:
  1. No argument for Date representing now.
  2. Single-argument value representing number of seconds since Unix Epoch
  or a Date object.
  @param {number|Date=} opt_value
  @return {Date} New date with time set to midnight.