Skip to content

Commit

Permalink
handle datetimes correctly in xlsx
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Jan 4, 2025
1 parent ca381c5 commit 57fd7cc
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 12 deletions.
72 changes: 64 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ serde_yaml = {version = "0.9.33", optional = true}

# Feature dependencies
arboard = {version = "3", optional = true}
calamine = {version = "0.24.0", optional = true}
calamine = {version = "0.26.1", optional = true}
color_quant = {version = "1.1", optional = true}
cosmic-text = {version = "0.12.1", optional = true}
csv = {version = "1", optional = true}
Expand Down
8 changes: 5 additions & 3 deletions src/algorithm/monadic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2245,9 +2245,11 @@ impl Value {
&Data::Float(f) => f.into(),
Data::String(s) => s.clone().into(),
&Data::Bool(b) => b.into(),
Data::DateTime(dt) => dt.to_string().into(),
Data::DateTimeIso(dt) => dt.to_string().into(),
Data::DurationIso(dur) => dur.to_string().into(),
Data::DateTime(dt) => {
((dt.as_f64() - 2.0) * 24.0 * 60.0 * 60.0 - 2208988800.0).into()
}
Data::DateTimeIso(dt) => dt.clone().into(),
Data::DurationIso(dur) => dur.clone().into(),
Data::Error(e) => e.to_string().into(),
Data::Empty => String::new().into(),
}));
Expand Down

0 comments on commit 57fd7cc

Please sign in to comment.