Natively support the %Y-%b-%d date format

For parsing dates such as 2020-Jan-01, as seen on https://www.electronjs.org/docs/latest/tutorial/electron-timelines.
This commit is contained in:
Marc Wrobel
2024-02-23 23:22:22 +01:00
parent a81bd82c29
commit 8fff6e9cbe

View File

@@ -8,6 +8,7 @@ def parse_date(text: str, formats: list[str] = frozenset([
"%d %B %Y", # 1 January 2020
"%d %b %Y", # 1 Jan 2020
"%d-%b-%Y", # 1-Jan-2020
"%Y-%b-%d", # 2020-Jan-01
"%d-%B-%Y", # 1-January-2020
"%Y-%m-%d", # 2020-01-01
"%m/%d/%Y", # 01/25/2020