Error "Uncaught RangeError: Invalid time value" in view navigating

Hi,

While I am in Day view and navigate to date in which I have data, and from that When I am clicking on WorkWeek  view, It is working and loaded workweek view properly.

Workweek3.PNG

But while I am in Day view and don't have any data, and from that When I am clicking on WorkWeek  view, onNavigating event is executed and going to render timescale's majorSlotTemplate and  minorSlotTemplate, for that I am using template.


<script id="majorSlotTemplate" type="text/x-template">

      <div>${majorSlotTemplate(data.date)}</div>

</script>

<script id="minorSlotTemplate" type="text/x-template">

     <div style="text-align: right; margin-right: 15px">${minorSlotTemplate(data.date)}</div>

</script>

<script type="text/javascript">

window.majorSlotTemplate = function (date) {

    var instance = new ej.base.Internationalization();

    return instance.formatDate(date, { skeleton: 'hm' });

};

window.minorSlotTemplate = function (date) {

    var instance = new ej.base.Internationalization();

    return instance.formatDate(date, { skeleton: 'hm' });

};

</script>

Now, I am getting following error, when it tries to render last minorSlotTemplate, please refer following snapshot.

Uncaught RangeError: Invalid time value

    at Date.toISOString (<anonymous>)

    at e.generateQuery (ej2.min.js:1)

    at e.refreshDataManager (ej2.min.js:1)

    at e.render (ej2.min.js:1)

    at t.initializeView (ej2.min.js:1)

    at e.<anonymous> (ej2.min.js:1)

    at e.notify (ej2.min.js:1)

    at t.e.trigger (ej2.min.js:1)

    at e.<anonymous> (ej2.min.js:1)

    at e.notify (ej2.min.js:1)


Workweek2.PNG


Thanks.


3 Replies

VD Vinitha Devi Murugan Syncfusion Team September 29, 2021 10:16 AM UTC

Hi SMD_DigiDev1, 
 
Greetings from Syncfusion Support.  
 
We have validated your reported query “Error "Uncaught RangeError: Invalid time value" in view navigating” at our end by preparing sample with your shared code. We could not replicate that script error while view change. We have prepared below sample for your reference.  
 
 
Kindly refer the above sample. If you still facing the same problem share us the below details to serve your better.  
 
  • Share Scheduler package version
  • Share the complete code snippets of scheduler.
  • Try to replicate the issue in our shared sample or
  • Share any issue replicating sample(if possible)
  
Regards,  
Vinitha 



VP Vipul Patel replied to Vinitha Devi Murugan September 29, 2021 01:04 PM UTC

Hi,


I am unable to download provided sample, please refer to the following snap.

error.PNG




NR Nevitha Ravi Syncfusion Team September 30, 2021 08:31 AM UTC

Hi SMD_DigiDev1, 

Sorry for the inconvenient. 

Can you please try the following downloadable link and let us know if you need any further assistance? 

Regards, 
Nevitha  


Loader.
Up arrow icon