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

Fix problem in Datetime that causes momentjs warning #429

Merged
merged 2 commits into from
Mar 2, 2017

Conversation

gamtiq
Copy link
Contributor

@gamtiq gamtiq commented Mar 1, 2017

When a non ISO format is used for a Datetime component it leads to a warning (and sometimes causes an error, it depends on format and environment).
For example, the following code

<template>
  <div>
    <q-datetime v-model="time" format="DD.MM.YYYY, HH:mm:ss" type="datetime"></q-datetime>
  </div>
</template>

<script>
export default {
  data () {
    return {
      time: ''
    }
  }
}
</script>

produces this warning:

Deprecation warning: value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments: 
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: 01.03.2017, 11:47:08, _f: undefined, _strict: undefined, _locale: [object Object]
Error
    at Function.eval [as createFromInputFallback] (eval at <anonymous> (http://localhost:8080/js/app.js:789:1), <anonymous>:318:94)
    at configFromString (eval at <anonymous> (http://localhost:8080/js/app.js:789:1), <anonymous>:2080:15)
    at configFromInput (eval at <anonymous> (http://localhost:8080/js/app.js:789:1), <anonymous>:2444:9)
    at prepareConfig (eval at <anonymous> (http://localhost:8080/js/app.js:789:1), <anonymous>:2427:9)
    at createFromConfig (eval at <anonymous> (http://localhost:8080/js/app.js:789:1), <anonymous>:2394:40)
    at createLocalOrUTC (eval at <anonymous> (http://localhost:8080/js/app.js:789:1), <anonymous>:2481:12)
    at createLocal (eval at <anonymous> (http://localhost:8080/js/app.js:789:1), <anonymous>:2485:12)
    at hooks (eval at <anonymous> (http://localhost:8080/js/app.js:789:1), <anonymous>:16:25)
    at VueComponent.model (eval at <anonymous> (http://localhost:8080/js/app.js:1511:1), <anonymous>:3987:41)
    at Watcher.run (eval at <anonymous> (http://localhost:8080/js/app.js:796:1), <anonymous>:3017:19)

I have fixed this problem.

@rstoenescu rstoenescu merged commit 4ca12c1 into quasarframework:dev Mar 2, 2017
@rstoenescu
Copy link
Member

Good catch! Thanks for taking time for a PR!

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

Successfully merging this pull request may close these issues.

2 participants