question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing view from month to week or day or agenda crashes the app

See original GitHub issue

Bug: Changing view from month to week or day or agenda crashes the app

I suspect this has to do something with a wrong dependency on date-arithmetic.js. If i change the createAccessor function on date-arithmetic.js > Index.js file to the following it fixes the issue.

function createAccessor(method){
    return function(date, val){
     if (val === undefined)
      {
        try{
          return date['get' + method]()
        }
        catch(e){
          return date[method.toLocaleLowerCase()]()
        }
      }

    date = new Date(date)
    try {
      date['set' + method](val)
    }
    catch(e){
      date[method.toLocaleLowerCase()](val)
    }
    return date
  }
}

I think all you need to do is point to the correct version of date-arithemetic.js

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
nakulsolankicommented, Jan 15, 2018

For my code changing

'start': moment(t.runAt), 'end': moment(t.runAt).add(30, 'minute')

to 

'start': moment(t.runAt).toDate(), 'end': moment(t.runAt).add(30, 'minute').toDate()

made it work

4reactions
SergioMendoliacommented, Jan 15, 2018

After some digging, I could correct the problem by changing the Events start and end dates to Date() objects. I provided Moment() objects, which worked fine for the month view, but not for the others, since arithmetics tries to access getHours().

Read more comments on GitHub >

github_iconTop Results From Across the Web

App crash while month view change to week or day #1410
Hello, I am trying to changing month view from month to day or week but in meantime I got error and app is...
Read more >
Changing view from month to week or day or agenda crashes ...
Bug : Changing view from month to week or day or agenda crashes the app. I suspect it is something to do with...
Read more >
Change how you view events in Calendar on iPhone
To change your view of Calendar, do any of the following: Zoom in or out: Tap a year, month, or day to zoom...
Read more >
Clock and Calendar Apps Keep Crashing on iPhone in iOS ...
iOS 14.4 Cannot add Alarm it crashes, how to fix Calendar app keeps crashing on iPhone, Clock app crashes when add Alarm in...
Read more >
Fix Google Calendar App Keeps Crashing Problem ... - YouTube
GoogleCalendar #Fix # Crashing #ProblemHello Friends today, In this Tutorial, i will show you how to fix How To Fix Google Calendar App...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found