Skip to content

Commit

Permalink
simplifying code
Browse files Browse the repository at this point in the history
  • Loading branch information
dimastbk committed Jan 15, 2024
1 parent fb49967 commit 8daab80
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/datatype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ impl DataType {
let excel_epoch = EXCEL_EPOCH.get_or_init(|| {
chrono::NaiveDate::from_ymd_opt(1899, 12, 30)
.unwrap()
.and_hms_opt(0, 0, 0)
.unwrap()
.and_time(chrono::NaiveTime::MIN)
});
let f = if *f >= 60.0 { *f } else { *f + 1.0 };
let ms = f * MS_MULTIPLIER;
Expand Down Expand Up @@ -449,8 +448,7 @@ impl ExcelDateTime {
let excel_epoch = EXCEL_EPOCH.get_or_init(|| {
chrono::NaiveDate::from_ymd_opt(1899, 12, 30)
.unwrap()
.and_hms_opt(0, 0, 0)
.unwrap()
.and_time(chrono::NaiveTime::MIN)
});
let f = if self.is_1904 {
self.value + EXCEL_1900_1904_DIFF
Expand Down

0 comments on commit 8daab80

Please sign in to comment.