Change datetime string format. fix #27
authorCedric Godin <cedric.godin@me.com>
Tue, 11 Jun 2019 00:41:08 +0000 (20:41 -0400)
committerCedric Godin <cedric.godin@me.com>
Tue, 11 Jun 2019 00:41:08 +0000 (20:41 -0400)
audio-recorder.js
main.js

index a3cfa54d3f864614ec39807298edf67f0f9ce010..babd1d89adea0911d8bfc684f620d1f05690a230 100644 (file)
@@ -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 7b32fe6605cecdcf3ff542fc5a5ebbea51fdeb7b..4dee0f094376e4f51385782b6fb146bad7e1ee0a 100644 (file)
--- 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