From: Cedric Godin Date: Tue, 11 Jun 2019 00:41:08 +0000 (-0400) Subject: Change datetime string format. fix #27 X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=dd621b7f319d1b750e98fd5dbdcef227b31ec938;p=yn%2Fyn-odasweb.git Change datetime string format. fix #27 --- 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