You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
to/from toml doesn't use native TOML date format #11751
PR #11846 seems to have correctly parsed the datetime into the RFC3339 format and works correctly for reading (from toml). However, writing to a TOML string (to toml) the found string stores the datetime as a TOML string entry instead of as a Datetime because it is surrounded by quotation marks ( " ). As it seems to me, this is not the way datetime should be stored according to the TOML specifications https://toml.io/en/v1.0.0.
Example
~> {date: 2024-05-13} | to toml
date = "2024-05-13T00:00:00+00:00"
While the expected behavior is;
~> {date: 2024-05-13} | to toml
date = 2024-05-13T00:00:00+00:00
so just removing the quotation marks. I image this would be an easy change.
Activity
fdncred commentedon Feb 5, 2024
What are "TOML dates"? How do they differ?
kaathewisegit commentedon Feb 5, 2024
@fdncred, TOML has first-class date/time support: https://toml.io/en/v1.0.0#offset-date-time
This allows to store dates in TOML without converting them to and from strings.
fdncred commentedon Feb 5, 2024
Ah, ok. So, it has to be RFC3339 format. That should be an easy update somewhere in the to/from toml code for anyone interested in changing it.
Fixed to/from toml date format (#11846)
Fixed to/from toml date format (nushell#11846)
Fixed to/from toml date format (nushell#11846)
VinciTec commentedon May 13, 2024
PR #11846 seems to have correctly parsed the datetime into the RFC3339 format and works correctly for reading (
from toml). However, writing to a TOML string (to toml) the found string stores the datetime as a TOML string entry instead of as a Datetime because it is surrounded by quotation marks ( " ). As it seems to me, this is not the way datetime should be stored according to the TOML specifications https://toml.io/en/v1.0.0.Example
While the expected behavior is;
so just removing the quotation marks. I image this would be an easy change.
kaathewisegit commentedon May 30, 2024
@fdncred can You reopen this issue to track the
to tomlpart of it, please?Use native toml datetime type in `to toml` (nushell#13018)