Javascript Issue with skuid platform?

Does anyone know why this function wouldnt be recognized on skuid platform?

dateVar.setTime(dateVar.getTime())

I receive an error

"There was a problem rendering a component of type skootable: dateVar.getTime is not a function"




Comments

  • edited June 3
    I seemed to be able to make it work. Do you have your snippet? Are you loading
    $ = skuid.$;
    snippet:  
    image console log: image
  • edited January 2018
    $ = skuid.$;

    var model = skuid.$M('Contacts');
    var row = model.getFirstRow();
    var dateVar = row.LastContact;

    dateVar.setTime(dateVar.getTime());

    model.updateRow(row,{LastContact : dateVar});


  • edited January 2018
    Realized that we hadnt converted the milliseconds back to a date .. but still no joy

    var params = arguments[0],

    $ = skuid.$;

    var model = skuid.$M('AllContacts');
    var row = model.getFirstRow();
    var dateVar = row.LastContact;
    var now = dateVar.getTime();

    var date = new Date(now);

    model.updateRow(row,{LastContact : date});


  • edited January 2018
    Done .. Thanks for the assist

    var params = arguments[0],

    $ = skuid.$;

    var model = skuid.$M('AllContacts');
    var row = model.getFirstRow();
    var dateVar = new Date();
    var now = dateVar.getTime();

    var date = new Date(now);

    model.updateRow(row,{LastContact : date});
Sign In or Register to comment.