Skip to content

datetime-local input bug #130

Closed
Closed
@lkho

Description

@lkho

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions