Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[MdDatepicker] using format 'DD/MM/YYYY' exceeding stack size #1689

Closed
Simillo opened this issue Apr 19, 2018 · 8 comments · Fixed by #1698
Closed

[MdDatepicker] using format 'DD/MM/YYYY' exceeding stack size #1689

Simillo opened this issue Apr 19, 2018 · 8 comments · Fixed by #1698
Labels

Comments

@Simillo
Copy link

Simillo commented Apr 19, 2018

Steps to reproduce

Setting Vue.material.locale.dateFormat = 'DD/MM/YYYY'.
Trying to select a date using md-datepicker.

Which browser?

Chrome Canary.

What is expected?

Be able to select a date.

What is actually happening?

When selecting a date using the dateFormat is DD/MM/YYYY the watcher for selecteDate is again executed and then there is loop.

https://github.com/vuematerial/vue-material/blob/dev/src/components/MdDatepicker/MdDatepicker.vue#L88

Reproduction Link

https://codesandbox.io/s/6398yyjqn

@Samuell1 Samuell1 added the bug label Apr 19, 2018
@VdustR VdustR changed the title DatePicker using format 'DD/MM/YYYY' exceeding stack size [MdDatepicker] using format 'DD/MM/YYYY' exceeding stack size Apr 20, 2018
@terean-dspd
Copy link

the same with DD.MM.YYYY

Samuell1 pushed a commit that referenced this issue Jun 19, 2018
* refactor(MdDatepicker): computed locale options

* style(MdDatepicker): fix style

* refactor(MdDatepicker): Better flow for datepicker

BREAKING CHANGE: upgrade date-fns to 2.0.0-alpha.7

fix #1689

* feat(MdDatepicker): new props md-model-type

* fix(MdDatepicker): fix warn message template literals

* docs(Datepicker): fix props md-model-type

* style(MdDatepicker): lint

* fix(MdDatepicker): mdModelType validator name

* feat(MdDatepicker): dynamic date format supported

* docs(Datepicker): date format example

* docs(Configuration):

* docs(Configuration): better description
@terean-dspd
Copy link

With 'DD.MM.YYYY' Chrome hangs after 3 or 4 selects in a row.
Firefox is not...

@DavidLambauer
Copy link

Yeah, same here. Firefox seems to work fine but after selecting a couple of dates in a row with format DD.MM.YYYY, it hangs up.

@DavidLambauer
Copy link

I just tried to use the master branch instead of the release. Does not work either.

@VdustR
Copy link
Member

VdustR commented Jul 10, 2018

Try dev branch

@terean-dspd
Copy link

terean-dspd commented Jul 10, 2018

Bad luck...
Using dev branch, now I don't need to select dates 3-4 times. Chrome hangs up immediately...
Firefox is still ok...

@Samuell1
Copy link
Member

Samuell1 commented Jul 11, 2018

Dont forget to rebuild dev branch, we dont provide rebuilded dist files with fixes in dev branch

@abhimanusharma
Copy link

@Samuell1 I have two date-picker in the same form, one of them is giving date value as object Tue Jan 05 2021 00:00:00 GMT+0530 (India Standard Time) and other is logging out 2021-01-05 The data from first datepicker is giving error while inserting in my db. I even added computed

dateFormat: {
            get() {
                return this.$material.locale.dateFormat;
            },
            set() {
                this.$material.locale.dateFormat = 'yyyy-MM-dd';
            }
        }

but format is still giving format error.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
6 participants