@optimiser/common 1.0.302 → 1.0.304

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.
@@ -406,7 +406,7 @@ var GetDateRangeFromOperatorValue = function (operator, fiscalMonth, fiscalFrom)
406
406
  var getFiscalMonthIndex = moment_1.default.monthsShort().findIndex(function (month) { return month === fiscalMonth; });
407
407
  // GET FISCAL MONTH INDEX
408
408
  // if (operator.includes("Fiscal")) {
409
- if (operator.includes("Fiscal") || ["Year to Date", "year-to-date"].includes(operator)) {
409
+ if (operator.toLowerCase().includes("fiscal") || ["Year to Date", "year-to-date"].includes(operator)) {
410
410
  if (fiscalFrom === "End") {
411
411
  fiscalMonth = momentObj.clone().month(fiscalMonth).add(1, "months").format('MMM'); // Modify FiscalMonth in FiscalFrom - End
412
412
  }
@@ -595,7 +595,7 @@ var GetDateRangeFromOperatorValue = function (operator, fiscalMonth, fiscalFrom)
595
595
  }
596
596
  break;
597
597
  case "This Fiscal Year":
598
- case "this-fiscal-quarter":
598
+ case "this-fiscal-year":
599
599
  if (fiscalFrom === "Start") {
600
600
  if (getFiscalMonthIndex == 0 || getFiscalMonthIndex && getFiscalMonthIndex <= momentObj.clone().month()) {
601
601
  startDate = moment_1.default(startDate, currentDateFormat).clone().month(fiscalMonth).startOf('month').format(requiredDateFormat);
@@ -618,7 +618,7 @@ var GetDateRangeFromOperatorValue = function (operator, fiscalMonth, fiscalFrom)
618
618
  }
619
619
  break;
620
620
  case "Next Fiscal Year":
621
- case "next-fiscal-quarter":
621
+ case "next-fiscal-year":
622
622
  if (fiscalFrom === "Start") {
623
623
  if (getFiscalMonthIndex == 0 || getFiscalMonthIndex && getFiscalMonthIndex <= momentObj.clone().month()) {
624
624
  startDate = moment_1.default(startDate, currentDateFormat).clone().month(fiscalMonth).add(1, "years").startOf('month').format(requiredDateFormat);
@@ -4571,6 +4571,9 @@ function ValidateUserInput(options) {
4571
4571
  }
4572
4572
  field = schemaFields.find(function (x) { return x.Name == fieldName; });
4573
4573
  if (!field) return [3 /*break*/, 52];
4574
+ if ((field.UIDataType == 'date' || field.UIDataType == 'datetime') && IsStringValue(fieldData) && fieldData.trim() == '') {
4575
+ inputFields[fieldName] = null;
4576
+ }
4574
4577
  if (fieldData && IsStringValue(fieldData) && field.UIDataType != 'dropdown') {
4575
4578
  fieldData = fieldData.trim();
4576
4579
  if (["text", "email", "phone"].includes(field.UIDataType)) {
@@ -4662,7 +4665,7 @@ function ValidateUserInput(options) {
4662
4665
  {
4663
4666
  filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
4664
4667
  if (!filter.test(fieldData)) {
4665
- msg = 'Invalid email for ' + field.DisplayName + '!';
4668
+ msg = fieldData + ' is invalid email for ' + field.DisplayName + '!';
4666
4669
  }
4667
4670
  }
4668
4671
  return [3 /*break*/, 51];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.302",
3
+ "version": "1.0.304",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {