Skip to content

Commit

Permalink
fix calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
vol4tim committed Dec 24, 2024
1 parent 549037c commit 46edc3e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/sensor/SensorPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,14 @@ import Copy from "./Copy.vue";
export default {
emits: ["close"],
props: ["type", "point"],
props: ["type", "point", "startTime"],
components: { Chart, Copy, Bookmark },
data() {
return {
select: "",
measurement: this.type,
isShowPath: false,
store: useStore(),
start: moment().format("YYYY-MM-DD"),
maxDate: moment().format("YYYY-MM-DD"),
provider: this.$route.params.provider,
rttime: null /* used for realtime view */,
Expand All @@ -162,6 +161,12 @@ export default {
};
},
computed: {
start() {
return this.startTime
? moment.unix(this.startTime).format("YYYY-MM-DD")
: moment().format("YYYY-MM-DD");
},
locale() {
return localStorage.getItem("locale") || this.$i18n.locale || "en";
},
Expand Down
5 changes: 5 additions & 0 deletions src/views/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@modal="handlerModal"
@close="handlerClose"
@history="handlerHistoryLog"
:startTime="start"
/>
</template>

Expand Down Expand Up @@ -87,6 +88,8 @@ export default {
timeout: 5000,
maximumAge: 0,
},
start: null,
end: null,
};
},
computed: {
Expand Down Expand Up @@ -116,6 +119,8 @@ export default {
},
methods: {
async handlerHistory({ start, end }) {
this.start = start;
this.end = end;
this.status = "history";
this.providerObj.watch(null);
this.handlerClose();
Expand Down

0 comments on commit 46edc3e

Please sign in to comment.