Add and use array helper.
[e-mobility-charging-stations-simulator.git] / src / utils / Utils.js
index 216790bc368bc0e7664810138391d0e41129aa13..15ee30711ec2c3645626b0e6af071abd212c71aa 100644 (file)
@@ -128,7 +128,7 @@ class Utils {
 
   static basicFormatLog(prefixString = '') {
     const date = new Date();
-    return date.toISOString().substr(0, 19) + prefixString;
+    return date.toLocaleString() + prefixString;
   }
 
   static objectHasOwnProperty(object, property) {
@@ -145,6 +145,13 @@ class Utils {
     }
     return false;
   }
+
+  static isEmptyArray(object) {
+    if (Array.isArray(object) && object.length > 0) {
+      return false;
+    }
+    return true;
+  }
 }
 
 module.exports = Utils;