alsmanager_lib 1.0.88 → 1.0.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/modules.js +12 -2
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -1108,8 +1108,13 @@ function getDeviceConfigurationById(db_used, id_conf) {
1108
1108
  }
1109
1109
 
1110
1110
  function insertDeviceConfigurationSQLite(id_device, data, note) {
1111
+ var data_str = "";
1112
+ if (data) {
1113
+ var d = new Date(data);
1114
+ data_str = d.getFullYear() + "-" + String((d.getMonth() + 1)).padStart(2, '0') + "-" + String(d.getDate()).padStart(2, '0');
1115
+ }
1111
1116
  var query = "insert into device_changes (id_device, date_conf, note) values (";
1112
- query += id_device + ", '" + data + "', '" + note + "')";
1117
+ query += id_device + ", '" + data_str + "', '" + note + "')";
1113
1118
  return query;
1114
1119
  }
1115
1120
  function insertDeviceConfigurationMySQL(id_device, data, note) {
@@ -1133,8 +1138,13 @@ function insertDeviceConfiguration(db_used, id_device, data, note) {
1133
1138
  }
1134
1139
 
1135
1140
  function updateDeviceConfigurationSQLite(id_conf, data, note) {
1141
+ var data_str = "";
1142
+ if (data) {
1143
+ var d = new Date(data);
1144
+ data_str = d.getFullYear() + "-" + String((d.getMonth() + 1)).padStart(2, '0') + "-" + String(d.getDate()).padStart(2, '0');
1145
+ }
1136
1146
  var query = "update device_changes set ";
1137
- query += "date_conf = '" + data +"',";
1147
+ query += "date_conf = '" + data_str +"',";
1138
1148
  query += "note = '" + note + "' ";
1139
1149
  query += "where id = " + id_conf;
1140
1150
  return query;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alsmanager_lib",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "description": "Funzioni per ALSManager",
5
5
  "license": "ISC",
6
6
  "author": "Luca Cattani",