docs: function dateFromConfig(config) {
          var i, date, input = [], currentDate,
              yearToUse, fixYear, w, temp, lang, weekday, week;
  
          if (config._d) {
              return;
          }
  
          currentDate = currentDateArray(config);
  
          //compute day of the year from weeks and weekdays
          if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
              fixYear = function (val) {
                  return val ?
                    (val.length < 3 ? (parseInt(val, 10) > 68 ? '19' + val : '20' + val) : val) :
                    (config._a[YEAR] == null ? moment().weekYear() : config._a[YEAR]);
              };
  
              w = config._w;
              if (w.GG != null || w.W != null || w.E != null) {
                  temp = dayOfYearFromWeeks(fixYear(w.GG), w.W || 1, w.E, 4, 1);
              }
              else {
                  lang = getLangDefinition(config._l);
                  weekday = w.d != null ?  parseWeekday(w.d, lang) :
                    (w.e != null ?  parseInt(w.e, 10) + lang._week.dow : 0);
  
                  week = parseInt(w.w, 10) || 1;
  
                  //if we're parsing 'd', then the low day numbers may be next week
                  if (w.d != null && weekday < lang._week.dow) {
                      week++;
                  }
  
                  temp = dayOfYearFromWeeks(fixYear(w.gg), week, weekday, lang._week.doy, lang._week.dow);
              }
  
              config._a[YEAR] = temp.year;
              config._dayOfYear = temp.dayOfYear;
          }
  
          //if the day of the year is set, figure out what it is
          if (config._dayOfYear) {
              yearToUse = config._a[YEAR] == null ? currentDate[YEAR] : config._a[YEAR];
  
              if (config._dayOfYear > daysInYear(yearToUse)) {
                  config._pf._overflowDayOfYear = true;
              }
  
              date = makeUTCDate(yearToUse, 0, config._dayOfYear);
              config._a[MONTH] = date.getUTCMonth();
              config._a[DATE] = date.getUTCDate();
          }
  
          // Default to current date.
          // * if no year, month, day of month are given, default to today
          // * if day of month is given, default month and year
          // * if month is given, default only year
          // * if year is given, don't default anything
          for (i = 0; i < 3 && config._a[i] == null; ++i) {
              config._a[i] = input[i] = currentDate[i];
          }
  
          // Zero out whatever was not defaulted, including time
          for (; i < 7; i++) {
              config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
          }
  
          // add the offsets to the time to be parsed so that we can have a clean array for checking isValid
          input[HOUR] += toInt((config._tzm || 0) / 60);
          input[MINUTE] += toInt((config._tzm || 0) % 60);
  
          config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);
      }