Skip to content

Commit 230d1dc

Browse files
committed
fix(export): fix filename date config
1 parent 5852e8c commit 230d1dc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/views/settings/SettingsExport.vue

+11-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ const getOnClick = (scope: ExportScope, index: number) => async () => {
6969
}
7070
};
7171
72+
const timeRegex = /:/g;
73+
const separatorRegex = /[tT]/;
74+
const getDate = () =>
75+
new Date()
76+
.toISOString()
77+
.split('.')
78+
.at(0)
79+
?.replace(separatorRegex, '_')
80+
.replace(timeRegex, '-');
81+
7282
const fetchData = (type: ListTypes, name: string, entity?: ListEntity) => {
7383
const writer = {
7484
picker: {
@@ -77,7 +87,7 @@ const fetchData = (type: ListTypes, name: string, entity?: ListEntity) => {
7787
? i18n(`export_${name}_name`)
7888
: `${i18n(`export_${type}_name`)}_${name}`,
7989
user.value,
80-
new Date().toISOString(),
90+
getDate(),
8191
]
8292
.join('_')
8393
.replace(' ', '_')

0 commit comments

Comments
 (0)