Skip to content

Commit

Permalink
Merge pull request #118 from obgnail/dev
Browse files Browse the repository at this point in the history
month+1
  • Loading branch information
obgnail authored Aug 24, 2023
2 parents 5092d6c + 6fae485 commit 9916e27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/custom/plugins/templater.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class templateHelper {

dateOffset = offset => {
const day = new Date(this.today.getTime() + offset);
return `${day.getFullYear()}/${day.getMonth()}/${day.getDate()}`
return `${day.getFullYear()}/${day.getMonth() + 1}/${day.getDate()}`
}

uuid = () => this.utils.getUUID();
Expand All @@ -88,7 +88,7 @@ class templateHelper {
filepath = () => this.utils.Package.Path.join(this.folder(), this.title());
weekday = () => "周" + '日一二三四五六'.charAt(this.today.getDay());
datetime = () => this.today.toLocaleString('chinese', {hour12: false});
date = () => `${this.today.getFullYear()}/${this.today.getMonth()}/${this.today.getDate()}`;
date = () => `${this.today.getFullYear()}/${this.today.getMonth() + 1}/${this.today.getDate()}`;
time = () => `${this.today.getHours()}:${this.today.getMinutes()}:${this.today.getSeconds()}`;
yesterday = () => this.dateOffset(-24 * 60 * 60 * 1000);
tomorrow = () => this.dateOffset(24 * 60 * 60 * 1000);
Expand Down

0 comments on commit 9916e27

Please sign in to comment.