Uncaught TypeError - getDate is not a function

  • 1
  • Problem
  • Updated 2 years ago
  • In Progress
I'm getting this error from a line in a script:

Uncaught TypeError: jsloopStartDateTime.getDate is not a function

from this line:
var jsloopStartDateTime = skuid.time.parseSFDateTime(loopStartDateTime);
jsloopStartDateTime.setDate(jsloopStartDateTime.getDate() + 7);

Any tips?


Details: this script has run perfectly for months until 8/26. I tried updating to the current version of Skuid, but it didn't address the issue.
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
  • groovy

Posted 2 years ago

  • 1
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
bump^
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
typically that error means that jsloopStartDateTime is not a javascript datetime object. have you tried a console.log of jsloopStartDateTime between the two lines of code there? Make sure you're getting an actual date.

Could it be that loopStartDateTime isn't a salesforce datetime string?
You could always try something likeĀ 

var jsloopStartDateTime = skuid.time.parseSFDateTime(loopStartDateTime) || new Date();