Skip to content

Commit

Permalink
fix parse '2024-07-26 09:03:48+00'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiujia committed Jul 10, 2024
1 parent 3eb1a80 commit 0ed1855
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fastdate"
version = "0.3.29"
version = "0.3.30"
edition = "2021"
description = "Rust fast date carte"
readme = "Readme.md"
Expand Down
8 changes: 7 additions & 1 deletion src/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,13 @@ impl DateTime {
}

pub fn from_str_default(arg: &str, default_offset: i32) -> Result<DateTime, Error> {
let mut v = arg.to_string();
let mut v = {
let mut v = String::with_capacity(arg.len() + 6);
for x in arg.chars() {
v.push(x);
}
v
};
if v.len() == 10 {
v.push_str("T00:00:00.00");
}
Expand Down

0 comments on commit 0ed1855

Please sign in to comment.