oops, forgot to commit that important change

This commit is contained in:
Lendemor 2024-11-22 19:21:43 +01:00
parent 6f65dde25f
commit c757788c0b

View File

@ -210,11 +210,7 @@ class LiteralDatetimeVar(LiteralVar, DateTimeVar):
Returns:
LiteralDatetimeVar: The new instance of the class.
"""
if isinstance(value, datetime):
js_expr = f"'{value.year}-{value.month - 1}-{value.day} {value.hour}:{value.minute}:{value.second}, {value.microsecond})"
js_expr = f'"{str(value)}"'
elif isinstance(value, date):
js_expr = f"new Date({value.year}, {value.month - 1}, {value.day})"
js_expr = f'"{str(value)}"'
return cls(
_js_expr=js_expr,
_var_type=type(value),