-
Notifications
You must be signed in to change notification settings - Fork 532
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
Not including 'format' option in schema for an 'inputType: date' fails v2.2.2 #480
Comments
There's an issue I came across in Chrome recently where in value always has to be set in the format yyyy-mm-dd, regardless of how it's displayed on the screen and the submitted value will also always be in the same format. https://developers.google.com/web/updates/2012/08/Quick-FAQs-on-input-type-date-in-Google-Chrome |
@evild70 is this still an issue in the latest 2.3.x? |
Still an issue |
…etime-local" elements using the standard format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss), and "datetime" elements are converted into "datetime-local" (datetime is deprecated/obsolete).
@evild70 @tomdickie @vafl-brut - does this PR solve the problem? When there is no "format", the model will be set to the timestamp but the HTML5 field will still be set properly using YYYY-MM-DDTHH:mm:ss ... I also added a catch for "datetime" fields to convert them into "datetime-local" as "datetime" is obsolete now. |
fixes #480 - dates are always passed to "date" and "datetime-local" e…
* samples/fsfiddle-demo: jsfiddle-sample embedded into repo migrated VFG docs to newer GitBooks, created GitHub Repo for Docs to allow for easier maintenance, updated JSFiddle to use "latest" VFG, and created a CodePen version as well Codacy (guard-for-in) fix fixed code structure added "options" to VFG install function, appending custom "validators" to the validators object that are passed into `Vue.use(VueFormGenerator, { validators: { key: (value, field, model) => {} }) added an optional "unique" flag to "getFieldID" that appends lodash "uniqueId" to the ID when true. Fixes vue-generators#468 fixed single-quotes added "type" attribute to inside buttons schema, defaults to "button" when one is not provided fixes vue-generators#480 - dates are always passed to "date" and "datetime-local" elements using the standard format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss), and "datetime" elements are converted into "datetime-local" (datetime is deprecated/obsolete). added "item.disabled" logic, supporting both boolean values and a function that is passed a reference to the model to determine disabled logic based on the model. listen for model-updated from `fields`, and fix `debounceFormatFunction` property to match fieldInput's `debounceFormatFunc` instead. Fix required number input does not require a value
* master-origin: fix issue with null values on datetime 2.3.3 releases added newline migrated VFG docs to newer GitBooks, created GitHub Repo for Docs to allow for easier maintenance, updated JSFiddle to use "latest" VFG, and created a CodePen version as well code fix fixes an issue with fieldPikaday modifying the field schema and attaching `this.$el` to it, the pikadayOptions are now stored as `this.options` and created with `defaults({}, this.schema.pikadayOptions, {...})` to prevent this Codacy (guard-for-in) fix fixed code structure added "options" to VFG install function, appending custom "validators" to the validators object that are passed into `Vue.use(VueFormGenerator, { validators: { key: (value, field, model) => {} }) added an optional "unique" flag to "getFieldID" that appends lodash "uniqueId" to the ID when true. Fixes vue-generators#468 fixed single-quotes added "type" attribute to inside buttons schema, defaults to "button" when one is not provided fixes vue-generators#480 - dates are always passed to "date" and "datetime-local" elements using the standard format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss), and "datetime" elements are converted into "datetime-local" (datetime is deprecated/obsolete). added "item.disabled" logic, supporting both boolean values and a function that is passed a reference to the model to determine disabled logic based on the model. listen for model-updated from `fields`, and fix `debounceFormatFunction` property to match fieldInput's `debounceFormatFunc` instead. Fix required number input does not require a value feat: add maxElements slot to fieldVueMultiSelect
Not including the
format
option in the schema an input with theinputType: date
will cause validation to fail. It will reset the input and put the UNIX timestamp into the model. It will then put the following warning in the Chrome console:The specified value "1286686800000" does not conform to the required format, "yyyy-MM-dd".
This issue does not exist in
v2.1.1
.Correct schema:
Example: https://jsfiddle.net/evild70/w3e0p2a6/ (see Chrome console for warning)
I couldn't find any mention of this in the documentation.
The text was updated successfully, but these errors were encountered: