i.getTime is not a function

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
This javascript error:


Perhaps these conditions are the trouble?


Trying to use these as conditions for a date range filter on a table.

What is the best way to set defaults for a table's date range filter, if not this?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
bump
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
bumpity-bump-bump
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Matt,

It's that "StartDate" condition. We aren't parsing the "LAST_N_DAYS:30" bit into an actual JavaScript Date, which is leading to the JavaScript error. Unfortunately, that's just the way it is right now because that's a Salesforce convention, and server side, we're just letting SOQL do its thing. Pat did share a JavaScript way of going about it a while back, but as far as Skuid the product goes, you have a specify a single date or leave it blank at this point. We should handle that JavaScript error more gracefully though so that your page doesn't bomb. We'll get that addressed in an upcoming patch.
(Edited)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Thanks, J dot

I found Pat's post and am now using that.

(thanks again, Pat!)
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Sure thing! By the way, the fix turned out to be simpler than I thought, and it'll go out in Banzai Update 5. You'll be able to give those conditions values like "LAST_N_DAYS:30" now, and the queries will run accordingly, but the filter still won't reflect it.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Nice! Thanks.