This commit is contained in:
2020-03-04 17:49:32 +00:00
parent 02322ea6da
commit 589e8d4b9c
2 changed files with 21 additions and 3 deletions

View File

@@ -10,7 +10,7 @@
{ name: vm.lt("DateRangeLastMonth"), id: "**" },
{ name: vm.lt("DateRangeThisMonth"), id: "**" },
{ name: vm.lt("DateRangeNextMonth"), id: "**" },
{ name: vm.lt("DateRange14DayWindow"), id: "*14daywindow*" },
{ name: vm.lt("DateRange14DayWindow"), id: "**" },
{ name: vm.lt("DateRangePast"), id: "*past*" },
{ name: vm.lt("DateRangeFuture"), id: "*future*" },
{ name: vm.lt("DateRangeLastYear"), id: "*lastyear*" }, //prior year from jan to dec
@@ -196,6 +196,24 @@ 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 "*14daywindow*":
//Start with today
var dtAfter = dtToday;
//subtract 7 days
dtAfter = dtAfter.plus({ days: -7 });
//Add 15 days to dtAfter to get end date
var dtBefore = dtAfter.plus({ days: 15 });
//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();

View File

@@ -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:nextmonth");
console.log(relativeDatefilterCalculator.tokenToDates("*nextmonth*"));
console.log("test:14daywindow");
console.log(relativeDatefilterCalculator.tokenToDates("*14daywindow*"));
//[{"fld":"widgetname"},{"fld":"widgetstartdate","filter":{"items":[{"op":"=","value":"*past90days*","token":true}]}},{"fld":"widgetenddate"}]
if (lv == null) {
return lv;