if (/(Y+)/.test(format)) { format = format.replace(RegExp.$1, `${o['Y+']}`.substr(4 - RegExp.$1.length)) }
for (const k in o) { if (newRegExp(`(${k})`).test(format)) { const value = RegExp.$1.length > 1 && o[k] < 10 ? `0${o[k]}` : o[k] format = format.replace(RegExp.$1, value asstring) } } return format }
Date.prototype.addDays = function (days: number): Date{ if (days) { this.setDate(this.getDate() + days) } returnthis }
Date.prototype.isToday = function (): boolean{ returnthis.isSameDate(newDate()) }
Date.prototype.clone = function (): Date{ returnnewDate(+this) }
Date.prototype.isAnotherMonth = function (date: Date): boolean{ return date && this.getMonth() !== date.getMonth() }