mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 16:58:39 +02:00
chore: chrono_update (#7132)
chrono version update # Description upgrade chrono to 0.4.23 # Major Changes If you're considering making any major change to nushell, before starting work on it, seek feedback from regular contributors and get approval for the idea from the core team either on [Discord](https://discordapp.com/invite/NtAbbGn) or [GitHub issue](https://github.com/nushell/nushell/issues/new/choose). Making sure we're all on board with the change saves everybody's time. Thanks! # Tests + Formatting Make sure you've done the following, if applicable: - Add tests that cover your changes (either in the command examples, the crate/tests folder, or in the /tests folder) - Try to think about corner cases and various ways how your changes could break. Cover those in the tests Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace --features=extra` to check that all tests pass # After Submitting * Help us keep the docs up to date: If your PR affects the user experience of Nushell (adding/removing a command, changing an input/output type, etc.), make sure the changes are reflected in the documentation (https://github.com/nushell/nushell.github.io) after the PR is merged. Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
@ -184,12 +184,12 @@ impl MonthHelper {
|
||||
let next_month_naive_date =
|
||||
NaiveDate::from_ymd_opt(selected_year, selected_month, 1).ok_or(())?;
|
||||
|
||||
Ok(next_month_naive_date.pred().day())
|
||||
Ok(next_month_naive_date.pred_opt().unwrap_or_default().day())
|
||||
}
|
||||
}
|
||||
|
||||
fn get_current_date() -> (i32, u32, u32) {
|
||||
let local_now_date = Local::now().date();
|
||||
let local_now_date = Local::now().date_naive();
|
||||
|
||||
let current_year: i32 = local_now_date.year();
|
||||
let current_month: u32 = local_now_date.month();
|
||||
|
@ -195,10 +195,9 @@ pub fn run_seq_dates(
|
||||
day_count: Option<Value>,
|
||||
reverse: bool,
|
||||
) -> Result<Value, ShellError> {
|
||||
let today = Local::today().naive_local();
|
||||
let mut step_size: i64 = increment
|
||||
.as_i64()
|
||||
.expect("unable to change increment to i64");
|
||||
let today = Local::now().date_naive();
|
||||
// if cannot convert , it will return error
|
||||
let mut step_size: i64 = increment.as_i64()?;
|
||||
|
||||
if step_size == 0 {
|
||||
return Err(ShellError::GenericError(
|
||||
|
Reference in New Issue
Block a user