Fix form datetime bug