Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

feat(datepicker): alt-input-formats #4952

Closed
wants to merge 5 commits into from

Conversation

davious
Copy link
Contributor

@davious davious commented Nov 25, 2015

fixes #4951

Review on Reviewable

@@ -811,6 +813,9 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi

if (angular.isString(viewValue)) {
var date = dateParser.parse(viewValue, dateFormat, scope.date);
for(var i = 0; isNaN(date) && i < altInputFormats.length; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense to move the isNaN check to inside the loop after the dateParser is run? That way one can just break out of the loop if it is a valid date.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I plan to move the isNaN(date) to inside the loop.

_(Default: [])_:
A list of alternate formats acceptable for manual entry.

### Keyboard Support ###s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove that extra s and lowercase that support (not sure why you even touched that anyway).

Also the [] on the default needs to be between backsticks.

@wesleycho wesleycho added this to the 1.0.0 milestone Nov 26, 2015
@wesleycho wesleycho closed this in 8bfeda0 Nov 26, 2015
davious added a commit to davious/angular-ui-bootstrap that referenced this pull request Nov 28, 2015
- Adds support for multiple input formats

Closes angular-ui#4951
Closes angular-ui#4952
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datepicker popup: Support Multiple Input Formats
3 participants