Updated code to more accurately handle effectiveDateTime and expirationDateTime fields