Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually entered dates issues #26

Open
Dancia opened this issue May 11, 2017 · 2 comments
Open

Manually entered dates issues #26

Dancia opened this issue May 11, 2017 · 2 comments

Comments

@Dancia
Copy link

Dancia commented May 11, 2017

I use format 'YYYY-MM-DD' option and bind ng-model="formData.date" to my field. Now if I enter '2015-03-05aaaaa', the date is displayed as '2015-03-05', but my $scope.formData.date becomes '2015-03-05aaaaa'. So even if I write error message to user that date is invalid, in input field it looks like totally valid value '2015-03-05' (even though $scope.formData.date is not valid). How do I stop datetimepicker from automatically correcting my dates? this misleads users.

@atais
Copy link
Owner

atais commented May 16, 2017

Well...

The only solution I could think of is that the wrapper should parse the input first.
This feature is missing.

But maybe there is an easier option.
Did you find any solution? I am not actively developing this wrapper anymore.

@CapitanMorgan
Copy link

CapitanMorgan commented Jun 23, 2017

In order to achieve this a few things need to be done.

  1. Use the following options for the date time picker
    keepInvalid: true, useStrict: true
    Options Reference
    Example Fiddle

  2. With those settings applied, entering such a type of data, the current version of the library goes into a infinite digest loop, and bogs down the page without resolving it properly. (caused by not checking if the moment objects are valid). This should be fixed in my fork, and I am working to submit a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants