meteor-bootstrap_key-value-tag-input
Advanced tools
Comparing version 3.2.3 to 3.3.0
@@ -316,2 +316,23 @@ 'use strict'; | ||
}; | ||
DateKeyValueType.mongoDateExpressionFor = function (value, field) { | ||
var _a, _b, _c, _d; | ||
switch (value.operator) { | ||
case "<": | ||
case ">=": | ||
return _a = {}, _a[field] = (_b = {}, _b[compOpToSelector(value.operator)] = moment(value.date).startOf("day").toDate(), _b), _a; | ||
case ">": | ||
case "<=": | ||
return _c = {}, _c[field] = (_d = {}, _d[compOpToSelector(value.operator)] = moment(value.date).endOf("day").toDate(), _d), _c; | ||
case "=": | ||
return { $and: [ | ||
this.mongoDateExpressionFor({ date: value.date, operator: "<=" }, field), | ||
this.mongoDateExpressionFor({ date: value.date, operator: ">=" }, field), | ||
] }; | ||
case "!=": | ||
return { $or: [ | ||
this.mongoDateExpressionFor({ date: value.date, operator: "<" }, field), | ||
this.mongoDateExpressionFor({ date: value.date, operator: ">" }, field), | ||
] }; | ||
} | ||
}; | ||
Object.defineProperty(DateKeyValueType.prototype, "dateFormat", { | ||
@@ -318,0 +339,0 @@ set: function (dateFormat) { |
{ | ||
"name": "meteor-bootstrap_key-value-tag-input", | ||
"version": "3.2.3", | ||
"version": "3.3.0", | ||
"description": "A reactive input field for tags and key-value data, developed for meteor apps running bootstrap.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -15,2 +15,3 @@ import { CompOperator, CompOpSymbol } from "../helpers/operators"; | ||
}; | ||
static mongoDateExpressionFor(value: DateKeyValue, field: string): object; | ||
private _dateFormat; | ||
@@ -17,0 +18,0 @@ set dateFormat(dateFormat: string); |
@@ -29,2 +29,23 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
DateKeyValueType.mongoDateExpressionFor = function (value, field) { | ||
var _a, _b, _c, _d; | ||
switch (value.operator) { | ||
case "<": | ||
case ">=": | ||
return _a = {}, _a[field] = (_b = {}, _b[compOpToSelector(value.operator)] = moment(value.date).startOf("day").toDate(), _b), _a; | ||
case ">": | ||
case "<=": | ||
return _c = {}, _c[field] = (_d = {}, _d[compOpToSelector(value.operator)] = moment(value.date).endOf("day").toDate(), _d), _c; | ||
case "=": | ||
return { $and: [ | ||
this.mongoDateExpressionFor({ date: value.date, operator: "<=" }, field), | ||
this.mongoDateExpressionFor({ date: value.date, operator: ">=" }, field), | ||
] }; | ||
case "!=": | ||
return { $or: [ | ||
this.mongoDateExpressionFor({ date: value.date, operator: "<" }, field), | ||
this.mongoDateExpressionFor({ date: value.date, operator: ">" }, field), | ||
] }; | ||
} | ||
}; | ||
Object.defineProperty(DateKeyValueType.prototype, "dateFormat", { | ||
@@ -31,0 +52,0 @@ set: function (dateFormat) { |
@@ -26,2 +26,23 @@ import { | ||
public static mongoDateExpressionFor(value: DateKeyValue, field: string): object { | ||
switch (value.operator) { | ||
case "<": | ||
case ">=": | ||
return { [field]: { [compOpToSelector(value.operator)]: moment(value.date).startOf("day").toDate() } }; | ||
case ">": | ||
case "<=": | ||
return { [field]: { [compOpToSelector(value.operator)]: moment(value.date).endOf("day").toDate() } }; | ||
case "=": | ||
return { $and: [ | ||
this.mongoDateExpressionFor({ date: value.date, operator: "<=" }, field), | ||
this.mongoDateExpressionFor({ date: value.date, operator: ">=" }, field), | ||
]}; | ||
case "!=": | ||
return { $or: [ | ||
this.mongoDateExpressionFor({ date: value.date, operator: "<" }, field), | ||
this.mongoDateExpressionFor({ date: value.date, operator: ">" }, field), | ||
]}; | ||
} | ||
} | ||
private _dateFormat: string = "YYYY-MM-DD"; | ||
@@ -28,0 +49,0 @@ set dateFormat(dateFormat: string) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
220952
4716