This commit is contained in:
2020-03-04 18:13:55 +00:00
parent 8275d2adf6
commit 72c3187745
2 changed files with 35 additions and 3 deletions

View File

@@ -21,7 +21,7 @@
},
{
name: vm.lt("DateRangeInTheLastSixMonths"),
id: "*last6months*"
id: "**"
},
{ name: vm.lt("DateRangePastYear"), id: "*pastyear*" }, //last 365 days
@@ -292,6 +292,38 @@ export default {
break;
case "*last6months*":
//From Now minus 6 months
var dtAfter = dtToday.plus({ months: -6 });
//Before now
var dtBefore = dtNow;
//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 "*pastyear*": //last 365 days
//From Now minus 365 days
var dtAfter = dtToday.plus({ days: -365 });
//Before now
var dtBefore = dtNow;
//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;
//--------------------------
}

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