diff --git a/ayanova/src/api/relative-date-filter-calculator.js b/ayanova/src/api/relative-date-filter-calculator.js index 477b4713..371e2000 100644 --- a/ayanova/src/api/relative-date-filter-calculator.js +++ b/ayanova/src/api/relative-date-filter-calculator.js @@ -8,7 +8,7 @@ { name: vm.lt("DateRangeThisWeek"), id: "**" }, { name: vm.lt("DateRangeNextWeek"), id: "**" }, { name: vm.lt("DateRangeLastMonth"), id: "**" }, - { name: vm.lt("DateRangeThisMonth"), id: "*thismonth*" }, + { name: vm.lt("DateRangeThisMonth"), id: "**" }, { name: vm.lt("DateRangeNextMonth"), id: "*nextmonth*" }, { name: vm.lt("DateRange14DayWindow"), id: "*14daywindow*" }, { name: vm.lt("DateRangePast"), id: "*past*" }, @@ -165,6 +165,27 @@ export default { //move after back a second for boundary dtAfter = dtAfter.plus({ seconds: -1 }); + //set return values from calculated values + ret.after = dtAfter.toUTC().toString(); + ret.before = dtBefore.toUTC().toString(); + break; + + case "*thismonth*": + //start with the first day of this month + // dtAfter = new DateTime(RelativeToday.Year, RelativeToday.Month, 1, RelativeToday.Hour, RelativeToday.Minute, 00); + + // //Add one month to dtAfter to get end date + // dtBefore = dtAfter.AddMonths(1); + + // //case 1155 + // dtAfter = dtAfter.AddSeconds(-1); + //start with the first day of this month + var dtAfter = window.$gz.DateTime.local(dtNow.year, dtNow.month, 1); + //Add one month to dtAfter to get end date + var dtBefore = dtAfter.plus({ months: 1 }); + //move after back a second for boundary + dtAfter = dtAfter.plus({ seconds: -1 }); + //set return values from calculated values ret.after = dtAfter.toUTC().toString(); ret.before = dtBefore.toUTC().toString(); diff --git a/ayanova/src/components/gz-data-table.vue b/ayanova/src/components/gz-data-table.vue index 74ae6faa..9b0e5036 100644 --- a/ayanova/src/components/gz-data-table.vue +++ b/ayanova/src/components/gz-data-table.vue @@ -916,8 +916,8 @@ function untokenizeListView(lv) { //iterate the array and build a new array with substituted tokens with the correct date and time in them //console.log(lv); //console.log(JSON.parse(lv)); - console.log("test:lastmonth"); - console.log(relativeDatefilterCalculator.tokenToDates("*lastmonth*")); + console.log("test:thismonth"); + console.log(relativeDatefilterCalculator.tokenToDates("*thismonth*")); //[{"fld":"widgetname"},{"fld":"widgetstartdate","filter":{"items":[{"op":"=","value":"*past90days*","token":true}]}},{"fld":"widgetenddate"}] if (lv == null) { return lv;