[PLAT-5679] Ported date logic fixes from 2.1 (Julian)