We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cannot read property 'getFullYear' of undefined

Thread ID:

Created:

Updated:

Platform:

Replies:

142103 Jan 18,2019 07:47 PM UTC Apr 4,2019 01:47 PM UTC Angular - EJ 2 3
loading
Tags: DatePicker
Altan Stalker
Asked On January 18, 2019 07:47 PM UTC

Hello,

I am using the DatePicker component in my application and am getting the error noted in the title. The component works as expected, but I am trying to get rid of the console error. I have copied a portion of the stack trace, which can be found below:

ERROR TypeError: Cannot read property 'getFullYear' of null
    at DatePickerComponent.CalendarBase.compareMonth (ej2-calendars.es5.js:1393)
    at DatePickerComponent.CalendarBase.iconHandler (ej2-calendars.es5.js:1029)
    at DatePickerComponent.CalendarBase.renderTemplate (ej2-calendars.es5.js:825)
    at DatePickerComponent.Calendar.renderTemplate (ej2-calendars.es5.js:1574)
    at DatePickerComponent.CalendarBase.renderMonths (ej2-calendars.es5.js:535)
    at DatePickerComponent.Calendar.renderMonths (ej2-calendars.es5.js:1562)
    at DatePickerComponent.CalendarBase.createContentBody (ej2-calendars.es5.js:293)
    at DatePickerComponent.CalendarBase.onPropertyChanged (ej2-calendars.es5.js:957)
    at DatePickerComponent.Calendar.onPropertyChanged (ej2-calendars.es5.js:1630)
    at DatePickerComponent.DatePicker.onPropertyChanged (ej2-calendars.es5.js:2743)
    at DatePickerComponent.Base.dataBind (ej2-base.es5.js:1171)
    at DatePickerComponent.Component.dataBind (ej2-base.es5.js:5161)

I can provide a larger stack trace if required.

Thanks!

Deepa Loganathan [Syncfusion]
Replied On January 21, 2019 08:23 AM UTC

Hi Altan,  
 
Thanks for contacting Syncfusion Support.  
 
We have analyzed the reported issue in Datepicker. Based on the stack trace provided in your update, we suspect that the reported issue was because, you were trying to access the Datepicker component even before the component is loaded in DOM.  
 
The EJ2 controls will be rendered and available in page for access only in the NgAfterViewInit life cycle event. So kindly check if you were accessing the controls’ instance before NgAfterViewInit event, in that case the console error might occur.  
 
Also, we have tried to reproduce the issue with a simple test sample and we were unable to reproduce the issue. Please find the test sample in below link.  
 
 
If this is not the case, kindly get back to us with the below details. 
 
1.      An issue reproducible sample by editing the above sample 
2.      Exact steps to replicate the reported issue.  
 
The details you provide will help us analyze further and provide a prompt solution based on your application requirement.  
 
 
Regards,  
Deepa L. 


Alex Herbig
Replied On April 3, 2019 05:46 PM UTC

Hello,

I've been able to reproduce this bug. I've included steps to reproduce the bug (and another one) in the html on the example. Please let me know if there's something I'm doing wrong. If possible, could you show me a way to accomplish the functionality displayed in the stackblitz without getting the errors from syncfusion?

https://stackblitz.com/edit/angular-3pav9e-vw2rf5

Ashokkumar Balasubramanian [Syncfusion]
Replied On April 4, 2019 01:47 PM UTC

Hi Altan, 
 
Sorry for the inconvenience. 
We were able to reproduce the reported issue “Cannot read property 'getFullYear' of null while assigning min value as null and Cannot read property 'classList' of undefined” while pass the min value if showTodayButton as false were confirmed as a bug at our end. This fix will be included in our upcoming patch release scheduled on 16th April 2019. We appreciate your patience until then. Please find the feedback link below. 
 
Regards, 
Ashokkumar B. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;