File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -87,10 +87,15 @@ def get_document_title(self, document: DocumentInfo) -> str:
8787 def get_document_effective (self , document : DocumentInfo ) -> datetime .date :
8888 """Return the document effective date in a local timezone from the URL."""
8989
90+ # Example URL formats (with variations):
9091 # jedilnik-kosilo-YYYY-MM-DD(-popravek).pdf
9192 # jedilnik-malica-YYYY-MM-DD(-popravek).pdf
93+ # 01-splet-K-YYYY-MM-DD(-popravek).pdf
94+ # 01-splet-M-YYYY-MM-DD(-popravek).pdf
95+
9296 date = re .search (
93- r"jedilnik-(?:kosilo|malica|K|M)-(\d+)-(\d+)-(\d+)(?:-[\w-]*)?\.(?:pdf|xlsx)" , document .url
97+ r"(?:jedilnik|\d+-splet)-(?:kosilo|malica|K|M)-(\d+)-(\d+)-(\d+)(?:-[\w-]*)?\.(?:pdf|xlsx)" ,
98+ document .url ,
9499 )
95100
96101 # The specified date is commonly Monday of the effective week
You can’t perform that action at this time.
0 commit comments