From dd621b7f319d1b750e98fd5dbdcef227b31ec938 Mon Sep 17 00:00:00 2001 From: Cedric Godin Date: Mon, 10 Jun 2019 20:41:08 -0400 Subject: [PATCH] Change datetime string format. fix #27 --- audio-recorder.js | 17 ++++++++++++++++- main.js | 6 +++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/audio-recorder.js b/audio-recorder.js index a3cfa54..babd1d8 100644 --- a/audio-recorder.js +++ b/audio-recorder.js @@ -111,7 +111,22 @@ exports.AudioRecorder = class AudioRecorder extends EventEmitter { console.log(`Recorder ${this.index} started`) console.log(`Recorder ${this.index} was ${this.active} active`) - let filename = path.join(this.workspacePath, `ODAS_${id}_${new Date().toISOString()}_${this.suffix}.wav`) + now = new Date() + + dateString = "" + dateString += now.getFullYear() + "-" + dateString += (now.getMonth()+1) + "-" + dateString += now.getDate() + + timeString = "" + timeString += now.getHours() + "-" + timeString += now.getMinutes() + "-" + timeString += now.getSeconds() + "-" + timeString += now.getMilliseconds() + + datetimeString = dateString + "_" + timeString + + let filename = path.join(this.workspacePath, `ODAS_${id}_${datetimeString}_${this.suffix}.wav`) this.path = filename try { diff --git a/main.js b/main.js index 7b32fe6..4dee0f0 100644 --- a/main.js +++ b/main.js @@ -81,9 +81,9 @@ app.on('activate', function () { const sockets = require('./servers.js') const record = require('./record.js') -const share = require('./share.js') -const configure = require('./configure.js') +require('./share.js') +require('./configure.js') odasStudio.odas = require('./odas.js') sockets.startTrackingServer(odasStudio) -sockets.startPotentialServer(odasStudio) +sockets.startPotentialServer(odasStudio) \ No newline at end of file -- 2.34.1