chore(web): timeline bucketing by day
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
public timeGroup = '';
|
||||
public date!: DateTime;
|
||||
public hasLabel = false;
|
||||
public hasDotIndicator = false;
|
||||
}
|
||||
|
||||
const calculateSegments = (buckets: AssetBucket[]) => {
|
||||
@@ -60,6 +61,10 @@
|
||||
height = 0;
|
||||
}
|
||||
|
||||
if (previous?.date.month !== segment.date.month) {
|
||||
segment.hasDotIndicator = true;
|
||||
}
|
||||
|
||||
height += segment.height;
|
||||
previous = segment;
|
||||
return segment;
|
||||
@@ -164,7 +169,7 @@
|
||||
>
|
||||
{segment.date.year}
|
||||
</div>
|
||||
{:else if segment.height > 5}
|
||||
{:else if segment.height > 5 && segment.hasDotIndicator}
|
||||
<div
|
||||
aria-label={segment.timeGroup + ' ' + segment.count}
|
||||
class="absolute right-0 mr-3 block h-[4px] w-[4px] rounded-full bg-gray-300"
|
||||
|
||||
@@ -86,7 +86,7 @@ export class AssetStore {
|
||||
options: AssetStoreOptions,
|
||||
private albumId?: string,
|
||||
) {
|
||||
this.options = { ...options, size: TimeBucketSize.Month };
|
||||
this.options = { ...options, size: TimeBucketSize.Day };
|
||||
this.store$.set(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user