aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fatcat_scholar/transform.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/fatcat_scholar/transform.py b/fatcat_scholar/transform.py
index ac80efc..f6e2c46 100644
--- a/fatcat_scholar/transform.py
+++ b/fatcat_scholar/transform.py
@@ -1,5 +1,6 @@
import sys
import argparse
+import datetime
from typing import List, Dict, Optional, Any, Sequence
from dynaconf import settings
@@ -95,7 +96,11 @@ def es_biblio_from_sim(sim: Dict[str, Any]) -> ScholarBiblio:
release_date = None
if len(date) == len("2000-01-01"):
- release_date = date
+ try:
+ datetime.date.fromisoformat(date)
+ release_date = date
+ except ValueError:
+ pass
return ScholarBiblio(
# release_ident=release.ident,