fix switching date reset to 1 issue