mirror of
https://github.com/storytold/gridcraft.git
synced 2026-12-01 10:14:21 -06:00
Excel writes a pivot cache's date items as ISO dates counting real days from 1899-12-30: a time is 1899-12-30T08:00:00 and serial 1 is 1899-12-31. GridCraft read them with DATE() rules, which move year 1899 on to 3799, so those items never matched the report's items. A refresh then put them after every item that did match, such as (blank), and saving wrote that wrong order into the file. ISO dates (pivot cache items, t="d" cells) now go through a calendar-date conversion that counts real days from the epoch, accepts 1900-02-29 as serial 60, and in the 1904 system takes 1899-12-30 as a time's date part. The cache writer uses the inverse, so serial 1 is written as 1899-12-31 as Excel does. DATE() keeps its own rules.