Skip to content

Commit

Permalink
fixes #341 - introduced debounce functionality into formatValueToModel
Browse files Browse the repository at this point in the history
* Updated to fecha 2.3.2

* Moved the majority of logic from computed.value.set() to new `updateModelValue(newValue, oldValue)` method to allow other components to use similar techniques.
If `formatValueToModel` returns a function, then the function is called without setting the model value.  It is the functions responsibility to call `this.updateModelValue(newValue, oldValue)`.
Otherwise, calls `this.updateModelValue(newValue, oldValue)` to execute the original logic.

* If the input type is date, datetime, or datetime-local then it creates a debounced function for setting the value in fieldInput's mounted hook and then returns a function that calls this debounced function from `formatValueToModel`

* Reduced the repeated code for date formatting by adding a DATETIME_FORMATS constant, and using that to
get the "format" for fecha.parse()
  • Loading branch information
zoul0813 committed Dec 12, 2017
1 parent 5c42f3e commit a46fe31
Show file tree
Hide file tree
Showing 6 changed files with 1,037 additions and 97 deletions.
6 changes: 3 additions & 3 deletions dist/vfg-core.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/vfg.js

Large diffs are not rendered by default.

Loading

0 comments on commit a46fe31

Please sign in to comment.