Skip to content

Commit

Permalink
The files opened by Weekly Review are now sorted by created date olde…
Browse files Browse the repository at this point in the history
…st to newest
  • Loading branch information
brandonkboswell committed Jun 4, 2023
1 parent 3685966 commit da6a562
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class WeeklyReview extends Plugin {
const files = this.app.vault.getMarkdownFiles();

let start = moment(moment().startOf('day')).subtract(this.settings.daysAgo, "days");
let recentFiles = files.filter(f => start.isBefore(moment(f.stat.ctime)));
let recentFiles = files.filter(f => start.isBefore(moment(f.stat.ctime))).sort((a, b) => b?.stat.ctime - a?.stat.ctime);

new Notice(`Opening ${recentFiles.length} files created in the last ${this.settings.daysAgo} days.`);

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "weekly-review",
"name": "Weekly Review",
"version": "1.0.1",
"version": "1.1.0",
"minAppVersion": "0.15.0",
"description": "This is opens all of the files you have created in the last week.",
"author": "Brandon Boswell",
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "weekly-review",
"version": "1.0.1",
"version": "1.1.0",
"description": "This is opens all of the files you have created in the last week in Obsidian.",
"main": "main.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"1.0.0": "0.15.0",
"1.0.1": "0.15.0"
"1.0.1": "0.15.0",
"1.0.2": "0.15.0",
"1.1.0": "0.15.0"
}

0 comments on commit da6a562

Please sign in to comment.