function cloneDate(date) {
  return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
}
function isEqual(first, second) {
  return first.getTime() === second.getTime();
}
function isBefore(first, second) {
  return first.getTime() < second.getTime();
}
function isBeforeOrEqual(first, second) {
  return first.getTime() <= second.getTime();
}
function isAfter(first, second) {
  return first.getTime() > second.getTime();
}
function isSameDay(first, second) {
  return first.getFullYear() === second.getFullYear() && first.getMonth() === second.getMonth() && first.getDate() === second.getDate();
}
function moveToDayOfWeek(date, dayOfWeek) {
  while (date.getDay() !== dayOfWeek)
    date.setDate(date.getDate() - 1);
  return date;
}
function pad(value, length = 0) {
  while (value.length < length)
    value = '0' + value;
  return value;
}
function toDayOfMonthString(date) {
  return pad(date.getDate().toString());
}
const months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'];
function toMonthAndYearString(strings, date) {
  return strings[months[date.getMonth()]] + ' ' + date.getFullYear();
}
function iterateMonth(date, count) {
  const clone = new Date(date);
  if (count === 0) {
    return clone;
  }
  return new Date(clone.setMonth(clone.getMonth() + count));
}
function iterateWeek(date, count) {
  const clone = new Date(date);
  if (count === 0) {
    return clone;
  }
  return new Date(clone.setDate(clone.getDate() + (count * 7)));
}
function iterateMinutes(date, count) {
  const clone = new Date(date);
  if (count === 0) {
    return clone;
  }
  return new Date(clone.setMinutes(clone.getMinutes() + count));
}

export { iterateMonth as a, isBefore as b, iterateWeek as c, isAfter as d, isEqual as e, isBeforeOrEqual as f, isSameDay as g, cloneDate as h, iterateMinutes as i, toDayOfMonthString as j, moveToDayOfWeek as m, toMonthAndYearString as t };
