I have created a dateTime function as below within my controller:
$scope.getDatetime = function() {
return (new Date()).toLocaleFormat("%A, %B %e, %Y") + "name.csv" ;
};
I am using gridOptions as below
$scope.gridOptions = {
exporterCsvFilename: 'getDatetime()',
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
columnDefs: [
{ field: 'Field1' },
{ field: 'Field1' }
]
};
Using the above syntax, the file is downloading with name as getDatetime().csv instead of displaying the actual date