text: var e=function(e,t){return new Date(new Date((e<12?t:t+1)+"-"+(e<12?e+1:1)+"-1").setDate(0)).getDate()},t={days:!0,hours:!0,minutes:!0,months:!0,seconds:!0,years:!0},n=function(e){return{day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),month:e.getMonth()+1,second:e.getSeconds(),tzOffset:e.getTimezoneOffset(),year:e.getFullYear()}};exports.getDaysInMonth=e,exports.defaultNeededPeriods=t,exports.getDateTimeObject=n,exports.getDateTimePeriods=function(r,o,a,u){void 0===r&&(r=new Date),void 0===u&&(u=t),u=Object.assign({},t,u),r=new Date(r.setMilliseconds(0));var i=new Date(r),s=!1,l=new Date(new Date(r).setFullYear(r.getFullYear()-100)),m=new Date(new Date(r).setFullYear(r.getFullYear()+100));o=o?new Date(o.setMilliseconds(0)):l,a=a?new Date(a.setMilliseconds(0)):m;var f=o.getTime(),c=a.getTime(),d=r.getTime();f>c&&(console.warn("min > max, setting min and max to defaults"),o=l,f=l.getTime(),a=m,c=m.getTime()),f>d&&(console.warn("min > value, setting value to min"),r=new Date(o),d=f,s=!0),c<d&&(console.warn("max < value, setting value to max"),r=new Date(a),d=c,s=!0);var g=n(o),h=n(a),y=n(r),D=u.days?Array.from({length:e(y.month,y.year)},function(e,t){return t+1}):[],w=u.months?Array.from({length:12},function(e,t){return t+1}):[],v=u.hours?Array.from({length:24},function(e,t){return t}):[],x=u.minutes?Array.from({length:60},function(e,t){return t}):[],T=u.seconds?Array.from({length:60},function(e,t){return t}):[];y.year===g.year&&(w=w.filter(function(e){return e>=g.month}),y.month===g.month&&(D=D.filter(function(e){return e>=g.day}),y.day===g.day&&(v=v.filter(function(e){return e>=g.hour}),y.hour===g.hour&&(x=x.filter(function(e){return e>=g.minute}),y.minute===g.minute&&(T=T.filter(function(e){return e>=g.second})))))),y.year===h.year&&(w=w.filter(function(e){return e<=h.month}),y.month===h.month&&(D=D.filter(function(e){return e<=h.day}),y.day===h.day&&(v=v.filter(function(e){return e<=h.hour}),y.hour===h.hour&&(x=x.filter(function(e){return e<=h.minute}),y.minute===h.minute&&(T=T.filter(function(e){return e<=h.second}))))));var A=u.years?Array.from({length:h.year-g.year+1},function(e,t){return g.year+t}):[];return{max:h,min:g,originalValue:n(i),originalValueChanged:s,periods:{days:D,hours:v,minutes:x,months:w,seconds:T,years:A},value:y}};
  //# sourceMappingURL=datetime-periods.js.map
  