Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

input[date] should be more flexible in accepting initial values (v1.3.0-beta.5) #7066

Open
marshall007 opened this issue Apr 10, 2014 · 4 comments

Comments

@marshall007
Copy link

Possibly related to #757

Currently the initial value of ngModel must either be a Date object or a ISO-8601 date (yyyy-MM-dd) formatted string. However, the typical JSON representation of dates is 2014-04-09T00:00:00.000Z. When fetching remote data, the user is forced to manually convert any such properties to Date objects before they can be used as the model.

When the initial ngModel value is a string, I think it makes sense for input[date] to handle the conversion to a Date object (and perhaps truncate the time portion).

@ilanbiala
Copy link

Agreed, I think that Angular's good abilities lie in its flexibility. I'd be willing to submit a PR if a collaborator is supportive of this.

@elkelk
Copy link

elkelk commented Aug 13, 2014

👍

@btford btford removed the gh: issue label Aug 20, 2014
@ograycode
Copy link

👍

@aviram83
Copy link

👍

Also the needs to set init value as date format in the controller destroy the use of ng-repeat

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

No branches or pull requests

7 participants