nushell/crates
Loïc Riegel 12a1eefe73
Move human date parsing into new command date from-human (#15495)
No related issue.
Decided in nushell's weekly meeting: see [meeting
notes](https://hackmd.io/rA1YecqjRh6I5m8dTq7BHw)

# Description
Converting a date as a human readable string to a datetime:
- currently: using the ``into datetime`` command
- after this change: using ``date from-human`` command

Also moved the ``--list-human`` flag to the new command.

# User-Facing Changes
- Users have to use a new command for parsing human readable datetimes.

Result:
```nushell
~> date from-human --list
╭────┬───────────────────────────────────┬──────────────╮
│  # │ parseable human datetime examples │    result    │
├────┼───────────────────────────────────┼──────────────┤
│  0 │ Today 18:30                       │ in 6 hours   │
│  1 │ 2022-11-07 13:25:30               │ 2 years ago  │
│  2 │ 15:20 Friday                      │ in 6 days    │
│  3 │ This Friday 17:00                 │ in 6 days    │
│  4 │ 13:25, Next Tuesday               │ in 3 days    │
│  5 │ Last Friday at 19:45              │ 16 hours ago │
│  6 │ In 3 days                         │ in 2 days    │
│  7 │ In 2 hours                        │ in 2 hours   │
│  8 │ 10 hours and 5 minutes ago        │ 10 hours ago │
│  9 │ 1 years ago                       │ a year ago   │
│ 10 │ A year ago                        │ a year ago   │
│ 11 │ A month ago                       │ a month ago  │
│ 12 │ A week ago                        │ a week ago   │
│ 13 │ A day ago                         │ a day ago    │
│ 14 │ An hour ago                       │ an hour ago  │
│ 15 │ A minute ago                      │ a minute ago │
│ 16 │ A second ago                      │ now          │
│ 17 │ Now                               │ now          │
╰────┴───────────────────────────────────┴──────────────╯

~> "2 days ago" | date from-human
Thu, 3 Apr 2025 12:03:33 +0200 (2 days ago)

~> "2 days ago" | into datetime
Error: nu:🐚:datetime_parse_error

  × Unable to parse datetime: [2 days ago].
   ╭─[entry #5:1:1]
 1 │ "2 days ago" | into datetime
   · ──────┬─────
   ·       ╰── datetime parsing failed
   ╰────
  help: Examples of supported inputs:
         * "5 pm"
         * "2020/12/4"
         * "2020.12.04 22:10 +2"
         * "2020-04-12 22:10:57 +02:00"
         * "2020-04-12T22:10:57.213231+02:00"
         * "Tue, 1 Jul 2003 10:52:37 +0200"
```

# Tests + Formatting
Fmt, clippy 🆗 
Tests 🆗 

> Note: I was able to reactivate one unit test in the ``into datetime``
command

# After Submitting
Here since the user facing changes are significant, I think we should
communicate in the released notes. Otherwise the automatically generated
documentation should be enough IMO.
2025-04-07 07:44:55 -05:00
..
nu_plugin_custom_values Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu_plugin_example Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu_plugin_formats Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu_plugin_gstat Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu_plugin_inc Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu_plugin_nu_example Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu_plugin_polars Fix clippy (#15489) 2025-04-06 09:49:28 +08:00
nu_plugin_python Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu_plugin_query bump to the latest rust version (#15483) 2025-04-03 21:08:59 +02:00
nu_plugin_stress_internals Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-cli refactor: command identified by name instead of span content (#15471) 2025-04-02 13:12:38 +02:00
nu-cmd-base Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-cmd-extra Replace some PipelineMismatch by OnlySupportsThisInputType by shell error (#15447) 2025-04-07 12:25:27 +02:00
nu-cmd-lang update shadow-rs to version 1 (#15462) 2025-04-03 14:08:51 +02:00
nu-cmd-plugin Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-color-config Rename user-facing 'date' to 'datetime' (#15264) 2025-03-21 13:36:21 -04:00
nu-command Move human date parsing into new command date from-human (#15495) 2025-04-07 07:44:55 -05:00
nu-derive-value Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-engine Fix clippy (#15489) 2025-04-06 09:49:28 +08:00
nu-explore Fix clippy (#15489) 2025-04-06 09:49:28 +08:00
nu-glob Remove nu-glob's dependency on nu-protocol (#15349) 2025-03-20 17:32:41 +01:00
nu-json Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-lsp refactor(lsp): align markdown doc string with output of --help (#15508) 2025-04-06 08:37:59 -05:00
nu-parser Fix Exbibyte parsing (#15515) 2025-04-07 13:36:23 +02:00
nu-path Fix clippy (#15489) 2025-04-06 09:49:28 +08:00
nu-plugin Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-plugin-core Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-plugin-engine Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-plugin-protocol Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-plugin-test-support Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-pretty-hex Bump to 0.103.1 dev version (#15347) 2025-03-19 00:12:01 -04:00
nu-protocol Reminder comment to update doc when adding $nu constants (#15481) 2025-04-07 00:38:17 -04:00
nu-std Fixes clip copy stripping control characters when de-ansifying (#15428) 2025-03-28 19:15:17 -04:00
nu-system add more columns to macos ps -l (#15341) 2025-03-20 09:53:19 -05:00
nu-table Fix clippy (#15489) 2025-04-06 09:49:28 +08:00
nu-term-grid Fix clippy (#15489) 2025-04-06 09:49:28 +08:00
nu-test-support Remove nu-glob's dependency on nu-protocol (#15349) 2025-03-20 17:32:41 +01:00
nu-utils Fix typo in doc_config.nu + small description (#15461) 2025-03-31 21:38:50 +02:00
nuon Fix to nuon --serialize of closure (#15357) 2025-03-20 17:50:36 +01:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.