@optimiser/common 1.0.326 → 1.0.328

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.
@@ -2217,14 +2217,15 @@ function FilterConditions(condition, match, fields) {
2217
2217
  if (field.Schema.UIDataType === 'date' || field.Schema.UIDataType === 'datetime') {
2218
2218
  var operator = obj.Operator;
2219
2219
  var startCompareDate = void 0, endCompareDate = void 0;
2220
+ // below moment date was converted into utc by Shahzaib on 22/05/2023
2220
2221
  if (operator === "custom") {
2221
- startCompareDate = moment_1.default((_a = obj.Value) === null || _a === void 0 ? void 0 : _a.From, obj.DateFormat).startOf('day');
2222
- endCompareDate = moment_1.default((_b = obj.Value) === null || _b === void 0 ? void 0 : _b.To, obj.DateFormat).endOf('day');
2222
+ startCompareDate = moment_1.default.utc((_a = obj.Value) === null || _a === void 0 ? void 0 : _a.From, obj.DateFormat).startOf('day'); //moment(obj.Value.From).startOf('day');
2223
+ endCompareDate = moment_1.default.utc((_b = obj.Value) === null || _b === void 0 ? void 0 : _b.To, obj.DateFormat).endOf('day'); //moment(obj.Value.To).endOf('day');
2223
2224
  }
2224
2225
  else {
2225
2226
  var _d = helper_1.GetDateRangeFromOperatorValue(operator, obj.FiscalMonth, obj.FiscalFrom), startDate = _d.startDate, endDate = _d.endDate;
2226
- startCompareDate = moment_1.default(startDate, obj.DateFormat).startOf('day');
2227
- endCompareDate = moment_1.default(endDate, obj.DateFormat).endOf('day');
2227
+ startCompareDate = moment_1.default.utc(startDate, obj.DateFormat).startOf('day'); //moment(startDate).startOf('day');
2228
+ endCompareDate = moment_1.default.utc(endDate, obj.DateFormat).endOf('day'); //moment(endDate).endOf('day');
2228
2229
  }
2229
2230
  matchValue = { '$gte': new Date(moment_1.default(startCompareDate).toISOString()), '$lte': new Date(moment_1.default(endCompareDate).toISOString()) };
2230
2231
  }
@@ -5057,7 +5058,7 @@ function CheckConditionalField(field, record, action) {
5057
5058
  var msg = '';
5058
5059
  var fieldData = record[field.Name];
5059
5060
  if (field.Schema.ConditionalAction == 'enabled' && field.IsRequired == true) {
5060
- if (fieldData === '' || fieldData === null || (fieldData === undefined && action == "add")) {
5061
+ if (field.Schema.UIDataType != 'autoincrement' && (fieldData === '' || fieldData === null || (fieldData === undefined && action == "add"))) {
5061
5062
  msg = ((field.DisplayName || field.Schema.DisplayName) || field.Name) + ' is required!';
5062
5063
  }
5063
5064
  }
@@ -5067,7 +5068,7 @@ function CheckConditionalField(field, record, action) {
5067
5068
  case "enabled-mandatory":
5068
5069
  case "show-enabled-mandatory":
5069
5070
  case "show-disabled-mandatory":
5070
- if (fieldData === '' || fieldData === null || (fieldData === undefined && action == "add")) {
5071
+ if (field.Schema.UIDataType != 'autoincrement' && (fieldData === '' || fieldData === null || (fieldData === undefined && action == "add"))) {
5071
5072
  msg = ((field.DisplayName || field.Schema.DisplayName) || field.Name) + ' is conditionally required!';
5072
5073
  }
5073
5074
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.326",
3
+ "version": "1.0.328",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {