Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion resources/js/common/PMColumnFilterPopoverCommonMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const PMColumnFilterCommonMixin = {
},
{
"type": "datetime",
"includes": ["=", "<", "<=", ">", ">=", "contains", "regex"],
"includes": ["<", "<=", ">", ">="],
"control": "PMColumnFilterOpDatetime",
"input": ""
},
Expand Down Expand Up @@ -146,6 +146,9 @@ const PMColumnFilterCommonMixin = {
if (column.field === "status" || column.field === "assignee") {
operators = ["=", "in"];
}
if (column.field === "initiated_at" || column.field === "completed_at" || column.field === "due_at") {
operators = ["<", "<=", ">", ">=", "between"];
}
return operators;
},
getAssignee(filter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,13 @@
return root;
},
addItem(index) {
let operator = (this.format === "datetime") ? ">" : "=";
let item = {
subject: {
type: this.type,
value: this.value
},
operator: "=",
operator: operator,
value: "",
logical: "and",
viewControl: "PMColumnFilterOpInput"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
watch: {
value: {
handler(newValue) {
this.input = newValue;
this.input = this.convertFromISOString(newValue);
},
immediate: true
},
Expand All @@ -63,8 +63,22 @@
this.selectedTime = this.getCurrentTime(this.input);
},
methods: {
convertToISOString(dateString) {
let inUTCTimeZone = ''
if (dateString){
inUTCTimeZone = moment(dateString).tz('UTC').toISOString();
}
return inUTCTimeZone;
},
convertFromISOString(dateString) {
let inLocalTimeZone = dateString;
if (dateString){
inLocalTimeZone = moment(dateString).tz(window.ProcessMaker.user.timezone).format("YYYY-MM-DD HH:mm:ss");
}
return inLocalTimeZone;
},
emitInput() {
this.$emit("input", this.input);
this.$emit("input", this.convertToISOString(this.input));
},
setInput() {
this.input = this.selectedDate + " " + this.selectedTime;
Expand Down