diff options
author | Andrew Godwin | 2022-11-11 23:04:43 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-11 23:04:43 -0700 |
commit | 8fd5a9292c7d3aac352d3c0e96288bff8a79cb47 (patch) | |
tree | 3a9199c1d35a77d209cf424141fd4aa0e0694118 /core | |
parent | feb5d9b74fa1e8454eaaf29afae3643c6d7c81f1 (diff) | |
download | takahe-8fd5a9292c7d3aac352d3c0e96288bff8a79cb47.tar.gz takahe-8fd5a9292c7d3aac352d3c0e96288bff8a79cb47.tar.bz2 takahe-8fd5a9292c7d3aac352d3c0e96288bff8a79cb47.zip |
Posting and fan-out both working
Diffstat (limited to 'core')
-rw-r--r-- | core/ld.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,4 @@ +import datetime import urllib.parse as urllib_parse from typing import Dict, List, Union @@ -273,6 +274,8 @@ schemas = { }, } +DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" + def builtin_document_loader(url: str, options={}): # Get URL without scheme @@ -324,3 +327,7 @@ def canonicalise(json_data: Dict, include_security: bool = False) -> Dict: json_data["@context"] = context return jsonld.compact(jsonld.expand(json_data), context) + + +def format_date(value: datetime.datetime) -> str: + return value.strftime(DATETIME_FORMAT) |