Javascript and Date type from Salesforce

  • 1
  • Problem
  • Updated 4 years ago
Using in-line Javascript, a field in one of my models is returning a "Date" type field from Salesforce using getField on the model. When I display the field using an Alert, Javascript tells me its an object Object. On the Skuid page, the field is rendered at a datepicker.  I want to use the date field in a calculation against the current date using javascript in order to perform some actions.  I don't want to display the date in the Skuid page. Problem is, how do I get the date out of the date object using Javascript?  I've tried many ways, including skuid.time.parseSFDate and nothing is working.
Photo of Glenn Shesney

Glenn Shesney

  • 70 Points

Posted 4 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,828 Points 20k badge 2x thumb
This code has always successfully parsed a salesforce date into a javascript date: 

jsdate = skuid.time.parseSFDate(SFdateField);