@@ -509,11 +509,11 @@ project MainFrameDerived::LoadProject(const std::filesystem::path &p_as_fs){
509509 }
510510
511511 // get the modification date
512- string modifyDate;
512+ int64_t modifyDate;
513513 struct stat fileInfo {};
514514 if (filesystem::exists (p_as_fs)) {
515515 if (stat (p_as_fs.string ().c_str (), &fileInfo) == 0 ) {
516- modifyDate = ctime (& fileInfo.st_mtime ) ;
516+ modifyDate = fileInfo.st_mtime ;
517517 }
518518 }
519519
@@ -582,7 +582,7 @@ void MainFrameDerived::AddProject(const project& p, const std::string& filter, b
582582 projectsList->SetItemData (itemIndex, projectIndex);
583583
584584 projectsList->SetItem (itemIndex, 1 , p.version );
585- projectsList->SetItem (itemIndex, 2 , p.modifiedDate );
585+ projectsList->SetItem (itemIndex, 2 , p.modifyDateString () );
586586 projectsList->SetItem (itemIndex, 3 , p.path .string ());
587587
588588 // resize columns
@@ -760,9 +760,7 @@ int wxCALLBACK MainFrameDerived::CompareItems(wxIntPtr item1, wxIntPtr item2, wx
760760 break ;
761761 }
762762 case 2 : // Last Modified
763- // Compare dates - note: string comparison may not work correctly for all date formats
764- // For dates, default to newest first (reverse the comparison)
765- result = p2.modifiedDate .compare (p1.modifiedDate );
763+ result = int (std::clamp<int64_t >(p2.modifiedDate - p1.modifiedDate ,-10 ,10 ));
766764 break ;
767765 case 3 : // Path
768766 result = p1.path .string ().compare (p2.path .string ());
0 commit comments