fix: time buckets (#4358)

* fix: time buckets

* chore: update entity metadata

* fix: set correct localDateTime

* fix: display without timezone shifting

* fix: handle non-utc databases

* fix: scrollbar

* docs: comment how buckets are sorted

* chore: remove test/log

* chore: lint

---------

Co-authored-by: Jonathan Jogenfors <jonathan@jogenfors.se>
This commit is contained in:
Jason Rasmussen 2023-10-06 08:12:09 -04:00 committed by GitHub
parent 4a8887f37b
commit 35fa6397ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 35 deletions

View file

@ -1,5 +1,6 @@
<script lang="ts">
import type { AssetStore } from '$lib/stores/assets.store';
import { fromLocalDateTime } from '$lib/utils/timeline-util';
import { createEventDispatcher } from 'svelte';
export let timelineY = 0;
@ -92,9 +93,9 @@
{/if}
<!-- Time Segment -->
{#each segments as segment, index (segment.timeGroup)}
{@const date = new Date(segment.timeGroup)}
{@const year = date.getFullYear()}
{@const label = `${date.toLocaleString('default', { month: 'short' })} ${year}`}
{@const date = fromLocalDateTime(segment.timeGroup)}
{@const year = date.year}
{@const label = `${date.toLocaleString({ month: 'short' })} ${year}`}
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div