Use local time
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
`<script setup lang="ts">
|
||||
import EnvironmentCard from '@/components/EnvironmentCard.vue';
|
||||
import GraphModal from '@/components/GraphModal.vue';
|
||||
import HourlyForecast from '@/components/HourlyForecast.vue';
|
||||
import {formatDate} from '@ztimson/utils';
|
||||
import {onMounted, onUnmounted, ref} from 'vue';
|
||||
import {onMounted, onUnmounted, provide, ref} from 'vue';
|
||||
import MapView from '../components/MapView.vue';
|
||||
import CurrentWeather from '../components/CurrentWeather.vue';
|
||||
import ForecastStrip from '../components/ForecastStrip.vue';
|
||||
@@ -10,8 +12,11 @@ const day = ref(formatDate('dddd'));
|
||||
const date = ref(formatDate('MMMM D'));
|
||||
const time = ref(formatDate('h:mm A'));
|
||||
const props = defineProps<{dark: boolean}>();
|
||||
const selectedMetric = ref<string | null>(null);
|
||||
let clock: ReturnType<typeof setInterval>;
|
||||
|
||||
provide('openGraph', (key: string) => selectedMetric.value = key);
|
||||
|
||||
onMounted(async () => {
|
||||
clock = setInterval(() => {
|
||||
day.value = formatDate('dddd');
|
||||
@@ -161,13 +166,11 @@ onUnmounted(() => {
|
||||
<CurrentWeather />
|
||||
<HourlyForecast />
|
||||
<ForecastStrip />
|
||||
|
||||
<EnvironmentCard />
|
||||
</div>
|
||||
|
||||
<!-- <GraphModal-->
|
||||
<!-- :metric-key="selectedMetric"-->
|
||||
<!-- :current-data="current"-->
|
||||
<!-- @close="selectedMetric = null"-->
|
||||
<!-- />-->
|
||||
<GraphModal :metric-key="selectedMetric" @close="selectedMetric = null" />
|
||||
</div>
|
||||
</template>
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user