If date in file name, use that date

This commit is contained in:
2026-02-16 19:18:34 +09:00
parent 8764595cb0
commit 94e85979f1
2 changed files with 22 additions and 2 deletions
+2 -2
View File
@@ -219,11 +219,11 @@ class MainViewModel : BaseViewModel, IFontResolver
{
if (!string.IsNullOrWhiteSpace(filePath) && File.Exists(filePath) && !filePath.EndsWith(".DS_Store"))
{
// TODO: if date in file name, pull out that date instead
var date = Utilities.CheckValidDateInString(filePath);
ReportFiles.Add(new ReportFile()
{
Title = Path.GetFileName(filePath),
ReceiptDateTime = File.GetCreationTime(filePath),
ReceiptDateTime = date.HasValue ? date.Value.ToDateTime(TimeOnly.MinValue) : File.GetCreationTime(filePath),
Notes = "",
FilePath = filePath,
});