augustus-thomas / noteworthy

a local note taking app written in Python.
GNU General Public License v3.0
0 stars 0 forks source link

Search #38

Closed Chrisvann1 closed 8 months ago

Chrisvann1 commented 8 months ago

Search function is currently not printing the correct files for both the date and filename functions. Also, on the frontend there should be some error statement if the filename does not exist or if something is entered incorrectly.

tferrelCOW commented 8 months ago

Currently getting this on search: What would you like to do? search

Search Notes Would you like to search for file by modified date or by filename? Input 'date' or 'filename' for preferred search parameters: date Input the date you wish to search for and specify before or after (Format: 2000/12/31 before): 2024/2/20 after Traceback (most recent call last): File "c:\Users\Trent\Desktop\Schoolstuff\CS230\noteworthy git folder\noteworthy\Frontend.py", line 271, in Introduction() File "c:\Users\Trent\Desktop\Schoolstuff\CS230\noteworthy git folder\noteworthy\Frontend.py", line 268, in Introduction main() File "c:\Users\Trent\Desktop\Schoolstuff\CS230\noteworthy git folder\noteworthy\Frontend.py", line 238, in main SearchNotes() File "c:\Users\Trent\Desktop\Schoolstuff\CS230\noteworthy git folder\noteworthy\Frontend.py", line 106, in SearchNotes searchOutput = backend.search_date(date, searchDirection) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Trent\Desktop\Schoolstuff\CS230\noteworthy git folder\noteworthy\backend.py", line 74, in search_date this_epoch = string_to_epoch(this_date) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Trent\Desktop\Schoolstuff\CS230\noteworthy git folder\noteworthy\backend.py", line 11, in string_to_epoch epoch = datetime(*year_date_month).timestamp() ^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: month must be in 1..12

tferrelCOW commented 8 months ago

Should be the right format.