Skip to content

Commit

Permalink
Add suffix to exported filename (#3970)
Browse files Browse the repository at this point in the history
  • Loading branch information
jekkos committed Apr 30, 2024
1 parent b85b246 commit 2b016f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/js/manage_tables.js
Expand Up @@ -208,6 +208,7 @@
options = _options;
enable_actions = enable_actions(options.enableActions);
load_success = load_success(options.onLoadSuccess);
const export_suffix = new Date().toISOString().slice(0, 16).replace(/(-|\s*|T|:)*/g,"");
$('#table')
.addClass("table-striped")
.addClass("table-bordered")
Expand All @@ -228,7 +229,7 @@
exportDataType: 'basic',
exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel', 'pdf'],
exportOptions: {
fileName: options.resource.replace(/.*\/(.*?)$/g, '$1')
fileName: options.resource.replace(/.*\/(.*?)$/g, '$1') + "_" + export_suffix
},
onPageChange: function(response) {
load_success(response);
Expand Down

0 comments on commit 2b016f5

Please sign in to comment.