diff --git a/Application/FileConverter/PathHelpers.cs b/Application/FileConverter/PathHelpers.cs index 9c2d6ed..ea0b9aa 100644 --- a/Application/FileConverter/PathHelpers.cs +++ b/Application/FileConverter/PathHelpers.cs @@ -16,6 +16,7 @@ namespace FileConverter private static Regex pathRegex = new Regex(@"^(?:\\\\[^\\/:*?""<>|\r\n]+\\|[a-zA-Z]:\\)(?:[^\\/:*?""<>|\r\n]+\\)*[^\.\\/:*?""<>|\r\n][^\\/:*?""<>|\r\n]*$"); private static Regex filenameRegex = new Regex(@"[^\\]*", RegexOptions.RightToLeft); private static Regex directoryRegex = new Regex(@"^(?\\\\[^\\/:*?""""<>|\r\n]+\\|[A-Za-z]:\\)(?:(?[^\\]*)\\)*"); + private static Regex dateRegex = new Regex(@"\(d:(?[^)]*)\)"); public static bool IsPathDriveLetterValid(string path) { @@ -207,6 +208,8 @@ namespace FileConverter outputPath = outputPath.Replace("(n:i)", numberIndex.ToString()); outputPath = outputPath.Replace("(n:c)", numberMax.ToString()); + outputPath = dateRegex.Replace(outputPath, match => DateTime.Now.ToString(match.Groups["format"].Value).Replace('/', '-').Replace(':', '\'')); + outputPath += "." + outputExtension; return outputPath; diff --git a/CHANGELOG.md b/CHANGELOG.md index 170f935..579b349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Added: "Say thanks" button if you can't donate and want to keep my motivation up :). - Added: Messages logged from main thread are now displayed in the console standard output. - Added: Add the bookmarks in pdf when converting from word file (thanks to wangweirui). +- Added: Possibility to use conversion date in output file path template (github issue #56). - Added: Brazilian Portuguese translation (thanks to Marhc). - Added: Spanish translation (thanks to Chachak). - Added: Italian translation (thanks to Davide).