This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: vm.lt("DateRangeInTheLastSixMonths"),
|
name: vm.lt("DateRangeInTheLastSixMonths"),
|
||||||
id: "*last6months*"
|
id: "**"
|
||||||
},
|
},
|
||||||
{ name: vm.lt("DateRangePastYear"), id: "*pastyear*" }, //last 365 days
|
{ name: vm.lt("DateRangePastYear"), id: "*pastyear*" }, //last 365 days
|
||||||
|
|
||||||
@@ -292,6 +292,38 @@ export default {
|
|||||||
|
|
||||||
break;
|
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;
|
||||||
|
|
||||||
//--------------------------
|
//--------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
//iterate the array and build a new array with substituted tokens with the correct date and time in them
|
||||||
//console.log(lv);
|
//console.log(lv);
|
||||||
//console.log(JSON.parse(lv));
|
//console.log(JSON.parse(lv));
|
||||||
console.log("test:last3months");
|
console.log("test:pastyear");
|
||||||
console.log(relativeDatefilterCalculator.tokenToDates("*last3months*"));
|
console.log(relativeDatefilterCalculator.tokenToDates("*pastyear*"));
|
||||||
//[{"fld":"widgetname"},{"fld":"widgetstartdate","filter":{"items":[{"op":"=","value":"*past90days*","token":true}]}},{"fld":"widgetenddate"}]
|
//[{"fld":"widgetname"},{"fld":"widgetstartdate","filter":{"items":[{"op":"=","value":"*past90days*","token":true}]}},{"fld":"widgetenddate"}]
|
||||||
if (lv == null) {
|
if (lv == null) {
|
||||||
return lv;
|
return lv;
|
||||||
|
|||||||
Reference in New Issue
Block a user