MCPcopy Index your code
hub / github.com/idank/explainshell / _parse_date

Function _parse_date

tools/fetch_manned.py:431–443  ·  view source on GitHub ↗

Parse a YYYY-MM-DD release date into a sortable tuple. Missing or malformed dates (\\N, empty, non-ISO) collapse to (0, 0, 0) so they always lose ranking comparisons against real dates.

(s: str)

Source from the content-addressed store, hash-verified

429
430
431def _parse_date(s: str) -> tuple[int, int, int]:
432 """Parse a YYYY-MM-DD release date into a sortable tuple.
433
434 Missing or malformed dates (\\N, empty, non-ISO) collapse to (0, 0, 0)
435 so they always lose ranking comparisons against real dates.
436 """
437 if not s or s == "\\N":
438 return (0, 0, 0)
439 try:
440 y, m, d = s.split("-")
441 return (int(y), int(m), int(d))
442 except ValueError:
443 return (0, 0, 0)
444
445
446def select_content_ids(

Callers 1

load_metadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected