Fixed date input format for datefield, added tests