Repository navigation
Use native toml datetime type in to toml - #13018
Conversation
|
It looks like after the change in datetime format Also, it would be helpful to show what this format looks like. ❯ {datetime: 2024-05-31} | to toml
datetime = 2024-05-31T00:00:00+00:00or ❯ {datetime: (date now)} | to toml
datetime = 2024-05-31T06:39:14.282464-05:00 |
Uses `toml::value::DateTime` instead of `toml::Value::String`. Fix #11751
|
Adding some "breaking change for dummies" doc here since the original PR description wasn't clear to me (the dummy ;-)). I needed to fetch the PR to see what it was really doing. User-Facing ChangesNushell 0.91 previously changed For code that is using # In 0.94.2
~> {datetime: 2024-05-31} | to toml
datetime = "2024-05-31T00:00:00+00:00"
# After this PR
~> {datetime: 2024-05-31} | to toml
datetime = 2024-05-31T00:00:00+00:00
# In 0.94.2
~> {datetime: 2024-05-31} | to toml | from toml | get datetime | into datetime
Fri, 31 May 2024 00:00:00 +0000 (a week ago)
# After this PR
~> {datetime: 2024-05-31} | to toml | from toml | get datetime | into datetime
Error: nu::shell::only_supports_this_input_type
× Input type not supported.
╭─[entry #16:1:36]
1 │ {datetime: 2024-05-31} | to toml | from toml | get datetime | into datetime
· ────┬──── ──────┬──────
· │ ╰── only string and int input data is supported
· ╰── input type: date
╰────
# Fix - remove `into datetime`
~> {datetime: 2024-05-31} | to toml | from toml | get datetime
Fri, 31 May 2024 00:00:00 +0000 (a week ago) |
|
let's see how much this breaks things. thanks |
Description
Makes
to tomluse thetoml::value::Datetimetype, so thatto tomlserializes dates properly.User-Facing Changes
to tomlwill now encode dates differently, in a native format instead of a string. This could, in theory, break some workflows:Fix #11751