Convert TODAY and NOW to the workbook date system in 1904 workbooks (#578)

This commit is contained in:
MarekSpodBiedry
2026-10-12 08:34:40 +02:00
parent 3926d21aa9
commit ff14224ff9
6 changed files with 35 additions and 10 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ impl CfCache {
},
CfRule::TimePeriod { period, style } => match v.as_f64() {
Some(n) => {
let today = gridcraft_calc::now_serial().floor();
let today = gridcraft_core::date::serial_in_system(wb.date_system, gridcraft_calc::now_serial()).floor();
let d = n.floor();
let wd = gridcraft_core::date::datetime_from_serial(wb.date_system, today).map(|x| x.weekday as f64).unwrap_or(0.0);
let week_start = today - wd;