docs: function bymonth(rules, dt) {
      if(!rules || !rules.length) return dt;
  
      var candidates = rules.map(function(rule) {
          var delta = rule-m(dt);
          if(delta < 0) delta += 12;
  
          var newdt = add_m(new Date(dt), delta);
          set_d(newdt, 1);
          return newdt;
      });
  
      var newdt = sort_dates(candidates).shift();
      return newdt || dt;
  }