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

Cannot read property 'defaultDate' of undefined in Angular 6 #248

Open
basiltap opened this issue Jul 9, 2019 · 0 comments
Open

Cannot read property 'defaultDate' of undefined in Angular 6 #248

basiltap opened this issue Jul 9, 2019 · 0 comments

Comments

@basiltap
Copy link

basiltap commented Jul 9, 2019

I found this error try to show a multidatespicker:

core.js:1673 ERROR TypeError: Cannot read property 'defaultDate' of undefined
at s._get (jquery-ui.min.js:9)
at s._getDefaultDate (jquery-ui.min.js:9)
at s._inlineDatepicker (jquery-ui.min.js:8)
at s._attachDatepicker (jquery-ui.min.js:8)
at HTMLDivElement. (jquery-ui.min.js:9)
at Function.each (jquery.js:374)
at n.fn.init.each (jquery.js:139)
at n.fn.init.t.fn.datepicker (jquery-ui.min.js:9)
at HTMLDivElement.init (jquery-ui.multidatespicker.js:154)
at HTMLDivElement. (jquery-ui.multidatespicker.js:461)

My TypeScript:

          var today = new Date();
          var y = today.getFullYear();

          var holidays = [];
          holidays = data.holidays[0].Holidays.split(",");
          console.log(holidays);

          $("#holidayscalendar").multiDatesPicker({
            addDates: holidays,
            numberOfMonths: [4,3], // 4 rows of 3 columns each = 12 months
            defaultDate: '1/1/'+y, // First day of the Calendar
            firstDay: 1 // Start with Monday
          });

and imported in index.html

<script src="assets/plugins/bower_components/jquery-ui-multidatespicker/jquery-ui.multidatespicker.js"></script>

I cannot see anything in the application, and receive the error.

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

No branches or pull requests

1 participant