Skip to content

Conversation

@TCeason
Copy link

@TCeason TCeason commented Aug 19, 2024

  1. Enhanced time zone check

  2. modify default NaiveDate value set 1970-01-01 not today

Fix Issue: #46

1. Enhanced time zone check

2. modify default NaiveDate value set 1970-01-01 not today
@TCeason
Copy link
Author

TCeason commented Aug 19, 2024

Hi @bspeice , Please take some time to review this pr.

let default_date = default.unwrap_or(&Local::now().naive_local()).date();

let default_ts = NaiveDateTime::new(default_date, NaiveTime::from_hms_opt(0, 0, 0).unwrap());
// If default is none, 1970-01-01 00:00:00 as default value is better.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dateutil parser specifically uses the current time as a reference, I don't want to change that. Please keep the default as-is.

let signal = if l[i] == "+" { 1 } else { -1 };
let len_li = l[i].len();
// check next index's length
let timezone_len = l[i + 1].len();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the index here? It changes the meaning of the conditional below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants