core: fix on-the-fly is-all-day date conversion.

(cherry picked from commit 724bea73307427eaa40aaa1901bace1e3fe15983)