Use Date Inside Pivot Value Cell

Comments

1 comment

  • Avatar
    Delsaran Bigglesworth

    I ended up figuring out a suitable solution to my problem. The step were as follows, I converted the date into on Integer with this chunk of sql.

    GETYEAR([Date])*10000
    +GETMONTH([Date])*100
    +GETDAY([Date])

    After I had an Integer representation of a date in the cell I used some Jquery to format it the way I wanted. Using this in the "Edit Script" section.

    widget.on('ready', function(){
    $("div.table-grid__tbody div.table-grid__content__inner").map(function(i, cell) {

    var input = cell.innerHTML.replace(/(\d\d\d\d)(\d\d)(\d\d)/, "$2/$3/$1");
    // console.log('input');
    // console.log(input);

    cell.innerHTML = input;
    });
    });

    It's not perfect, there are some dates that look weird, but it's closer to my end goal. I hope this helps someone in the future. 

    fyi this was on Linux version.

    0
    Comment actions Permalink

Please sign in to leave a comment.