This commit is contained in:
zds
2022-06-28 09:56:47 +08:00
parent adf3bdb086
commit 4b908ac5da
2 changed files with 11 additions and 1 deletions

View File

@@ -19,6 +19,12 @@ Date.prototype.daysAgo = function(days, midnight) {
return midnight ? date.toMidnight() : date
}
Date.prototype.daysLater = function(days, midnight) {
days = days ? days + 0 : 0
const date = new Date(this.getTime() + days * 8.64E7)
return midnight ? date.toMidnight() : date
}
Date.prototype.monthBegin = function(offset) {
offset = offset ? offset - 0 : 0
const days = this.getDate() - 1 - offset