mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Deprecate date to-record
and date to-table
(#14319)
# Description Implements #11234 based on the comments there: * (Previously implemented): `into record` handles nanoseconds (as well as milliseconds and microseconds, which the deprecated commands didn't support). * Added deprecation warning to `date to-record` and `date to-table` * Added new example for `into record` showing the conversion to a table * Changed `std/dt` to use `into record` * Added "Deprecated" category back to nu-protocol::Signature * Assigned the deprecated commands to the Deprecated category so be categorized properly in the online Doc. # User-Facing Changes Deprecated command warning # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting Searched doc for existing uses of `date to-record` and `date to-table`: * For primary English-language docs, there are no uses other than in the auto-generated command help, which will be updated based on this PR * Other language translations appear to have an old use in several places and will need to be updated to match the English-language doc.
This commit is contained in:
@ -120,8 +120,8 @@ export def datetime-diff [
|
||||
}
|
||||
}
|
||||
}
|
||||
let from_expanded = ($later | date to-timezone utc | date to-record)
|
||||
let to_expanded = ($earlier | date to-timezone utc | date to-record)
|
||||
let from_expanded = ($later | date to-timezone utc | into record)
|
||||
let to_expanded = ($earlier | date to-timezone utc | into record)
|
||||
|
||||
mut result = { year: ($from_expanded.year - $to_expanded.year), month: ($from_expanded.month - $to_expanded.month), day:0, hour:0, minute:0, second:0, millisecond:0, microsecond:0, nanosecond:0}
|
||||
|
||||
|
Reference in New Issue
Block a user