docs: function (/*Date*/date1, /*Date*/date2, /*String*/portion) {
          date1 = new Date(date1);
          date2 = new Date((date2 || new Date()));
  
          if (portion === "date") {
              // Ignore times and compare dates.
              date1.setHours(0, 0, 0, 0);
              date2.setHours(0, 0, 0, 0);
          } else if (portion === "time") {
              // Ignore dates and compare times.
              date1.setFullYear(0, 0, 0);
              date2.setFullYear(0, 0, 0);
          }
          return date1 > date2 ? 1 : date1 < date2 ? -1 : 0;
      }