Skip to content

fixes #341 - introduced debounce functionality into formatValueToModel #360

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

Merged
merged 3 commits into from
Dec 12, 2017

Conversation

zoul0813
Copy link
Member

  • 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()

…rmatValueToModel`

* 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()
@zoul0813 zoul0813 requested a review from icebob December 12, 2017 17:03
@icebob
Copy link
Member

icebob commented Dec 12, 2017

Hmm, Travis is not working after organization. I'm fixing.

@icebob
Copy link
Member

icebob commented Dec 12, 2017

Could you modify a file (some space or enter) that the travis will be triggered?

@zoul0813
Copy link
Member Author

Well that's interesting, npm run test and npm run build ran without error on my end ... is Travis using different settings?

@icebob
Copy link
Member

icebob commented Dec 12, 2017

Travis was linked to the old "icebob/vue-form-generator" repo :)
I changed it to the new organization repo, now it's working.

@zoul0813
Copy link
Member Author

I was referring to the failure - Travis said I missed a comma and failed the validation, but on my end everything passed without error/warnings.

@icebob
Copy link
Member

icebob commented Dec 12, 2017

Hmm, interesting.

@icebob icebob merged commit 268631a into vue-generators:master Dec 12, 2017
@icebob
Copy link
Member

icebob commented Dec 12, 2017

Thanks, great 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