rtoml icon indicating copy to clipboard operation
rtoml copied to clipboard

Error when serializing dates and times

Open hukkin opened this issue 3 years ago • 3 comments

rtoml version: 0.7.0

Running this

import rtoml
rtoml.dumps(rtoml.loads("time = 23:30:59"))

Errors with

_rtoml.TomlSerializationError: time is not serializable to TOML: datetime.time(23, 30, 59)

hukkin avatar Jul 10 '21 14:07 hukkin

Looks like we don't currently process times.

PR welcome

samuelcolvin avatar Jul 10 '21 14:07 samuelcolvin

Same issue with dates it seems:

rtoml.dumps(rtoml.loads("date = 2021-01-01"))

hukkin avatar Jul 10 '21 14:07 hukkin

Ye, not yet implemented.

They need adding like datetime:

https://github.com/samuelcolvin/rtoml/blob/ccd2c01a210bcd3b7cf0be8dbbdedab352476e32/src/lib.rs#L151-L161

samuelcolvin avatar Jul 10 '21 15:07 samuelcolvin