diff --git a/outbreak.ts b/outbreak.ts index aaf27e0..372245e 100644 --- a/outbreak.ts +++ b/outbreak.ts @@ -25,6 +25,7 @@ interface ObsidianAppConfig { interface MigrationConfig { useNamespaces: boolean; + extraDailyNotesFormats: string[]; journalDateFormat: string; ignoredPaths: string[]; dryRun: boolean; @@ -116,7 +117,10 @@ function planFileMigration( const outputFormat = config.journalDateFormat; // Reformat the date string according to the configured format - const parsedDate = moment(inputFilename, inputFormat); + const parsedDate = moment(inputFilename, [ + inputFormat, + ...config.extraDailyNotesFormats, + ]); const reformattedDate = parsedDate.isValid() ? parsedDate.format(outputFormat) : inputFilename; @@ -269,10 +273,15 @@ async function executeMigrationPlan( const defaultConfig: MigrationConfig = { useNamespaces: false, + extraDailyNotesFormats: [ + "YYYY/YYYY-MM-DD", + "YYYY/MM/YYYY-MM-DD", + ], journalDateFormat: "YYYY-MM-DD", ignoredPaths: [ - "archive/**", + // "archive/**", "**/*.txt", + "**/*.json", ".*/**", // any hidden directories in the root "**/.*", // hidden files (anywhere) ],