diff --git a/components/recipes/AddCondition.vue b/components/recipes/AddCondition.vue
index fe05011..de0afda 100644
--- a/components/recipes/AddCondition.vue
+++ b/components/recipes/AddCondition.vue
@@ -60,7 +60,7 @@
no-filter
>
-
+
@@ -142,6 +142,9 @@ export default {
isWeekday() {
return this.selectedProperty?.value == "weekday"
},
+ isDateRange() {
+ return this.selectedProperty?.value == "dateRange"
+ },
isGarmin() {
return this.selectedProperty?.value == "garmin.sensor"
},
@@ -352,16 +355,16 @@ export default {
} else if (this.isLocation) {
result.value = this.locationInput.value
result.friendlyValue = this.locationInput.address
- } else if (this.selectedProperty.type == "time") {
- const arrTime = result.value.split(":")
- result.value = parseInt(arrTime[0]) * 3600 + parseInt(arrTime[1]) * 60
- result.friendlyValue = this.valueInput
- } else if (this.selectedProperty.type == "date") {
+ } else if (this.isDateRange) {
result.value = `${this.valueDateFrom},${this.valueDateTo}`
const year = new Date().getFullYear()
const fromDate = this.valueDateFrom.length == 5 ? this.$dayjs(`${year}-${this.valueDateFrom}`).format("MMM D") : this.$dayjs(this.valueDateFrom).format("MMM D, YYYY")
const toDate = this.valueDateTo.length == 5 ? this.$dayjs(`${year}-${this.valueDateTo}`).format("MMM D") : this.$dayjs(this.valueDateTo).format("MMM D, YYYY")
result.friendlyValue = `From ${fromDate} to ${toDate}`
+ } else if (this.selectedProperty.type == "time") {
+ const arrTime = result.value.split(":")
+ result.value = parseInt(arrTime[0]) * 3600 + parseInt(arrTime[1]) * 60
+ result.friendlyValue = this.valueInput
}
}