update date logic