Skip to content

Commit

Permalink
feat: support date
Browse files Browse the repository at this point in the history
  • Loading branch information
long2ice committed Nov 30, 2023
1 parent a9f4cc1 commit b1a5ca0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion meilisync/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def mapping_data(self, fields_mapping: Optional[dict] = None):
for k, v in self.data.items():
if isinstance(v, datetime.datetime):
v = int(v.timestamp())

elif isinstance(v, datetime.date):
v = str(v)
if fields_mapping is not None and k in fields_mapping:
real_k = fields_mapping[k] or k
data[real_k] = v
Expand Down

0 comments on commit b1a5ca0

Please sign in to comment.