Skip to content

2758. Next Day 👍

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
declare global {
  interface Date {
    nextDay(): string;
  }
}

Date.prototype.nextDay = function () {
  const today = new Date(this.getTime());
  today.setDate(today.getDate() + 1);
  return today.toISOString().split('T')[0];
};