Skip to content

Commit

Permalink
fix date regex
Browse files Browse the repository at this point in the history
  • Loading branch information
david-loe committed Aug 22, 2024
1 parent 0697e39 commit 5926e29
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion common/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ export function csvToObjects(
escape = '"'
) {
const lines = csvToArray(csv, separator, escape)
console.log(lines)
let result = []
if (lines.length > 1) {
const headers = lines[0]
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/components/expenseReport/ExpenseReportPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,6 @@ export default defineComponent({
const mails = await this.getExaminerMails()
this.mailToLink = mailToLink(mails)
this.msTeamsToLink = msTeamsToLink(mails)
console.log(this.expenseReport.editor._id !== this.$root.user._id)
console.log(this.$root.user._id)
console.log(this.expenseReport.editor._id)
if (this.$refs.tooltip) {
this.tooltip = new Tooltip(this.$refs.tooltip as Element)
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/settings/SettingsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{ path: 'settings.projects', key: 'identifier', array: $root.projects },
{ path: 'settings.organisation', key: 'name', array: $root.organisations },
{path: 'loseAccessAt', fn: (val:string) => {
const match = val.match(/^(?<d>[1-3]?\d)\.(?<m>1?\d).(?<y>\d\d\d\d)$/)
const match = val.match(/^(?<d>[0-3]?\d)\.(?<m>[0-1]?\d).(?<y>\d\d\d\d)$/)
if(match){
return match.groups!.y + '-' + match.groups!.m.padStart(2, '0') + '-' + match.groups!.d.padStart(2, '0')
}
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/components/settings/elements/CSVImport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,13 @@ export default defineComponent({
},
async submit(data: any[]) {
const result = await this.$root.setter<any[]>(this.endpoint, data)
if (result.error) {
console.log(result.error)
} else {
if (result.ok) {
this.$emit('imported')
}
},
downloadTemplate() {
//Uint8Array for UTF-8 BOM
const file = new File([new Uint8Array([0xef, 0xbb, 0xbf]), this.genTemplate()], 'template.csv', { type: 'text/csv' })
const file = new File([new Uint8Array([0xef, 0xbb, 0xbf]), this.genTemplate()], 'CSV Import.csv', { type: 'text/csv' })
download(file)
},
genTemplate(seperator = ';', pathSeperator = '.') {
Expand Down

0 comments on commit 5926e29

Please sign in to comment.