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

datetime-local input bug #130

Closed
lkho opened this issue Feb 23, 2017 · 4 comments
Closed

datetime-local input bug #130

lkho opened this issue Feb 23, 2017 · 4 comments

Comments

@lkho
Copy link
Contributor

lkho commented Feb 23, 2017

Bug

fieldInput.vue

			formatValueToModel(value) {
				if (value != null) {
					if (this.schema.inputType === "date" ||
						this.schema.inputType === "datetime" ||
						this.schema.inputType === "datetimelocal") {
						return new Date(value).getTime();
					}
				}
				
				return value;
			}

datetimelocal is incorrectshould be datetime-local

Also, I found that new Date(value) in chrome will treat the value as UTC if it has a 'T', but instead it is 'local without timezone', so the value returned will be wrong. don't know if other browsers would do the same: https://jsfiddle.net/setn3460/

So I suggest using Moment as it returns consistent values

@icebob
Copy link
Member

icebob commented Feb 27, 2017

Thanks. We won't change to using moment because we removed recently to decrease the bundle size.

@lkho
Copy link
Contributor Author

lkho commented Feb 27, 2017

then maybe we can parse that using another method such as regex as the format returned is stated in w3c thus i think it will not change?

@icebob icebob closed this as completed in 01ff885 Feb 27, 2017
icebob added a commit that referenced this issue Feb 27, 2017
@icebob
Copy link
Member

icebob commented Feb 27, 2017

Thanks!

@icebob
Copy link
Member

icebob commented Mar 1, 2017

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

No branches or pull requests

2 participants