mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Updated weekly session labels.
This commit is contained in:
parent
ffa954ee02
commit
7add059f43
@ -20,16 +20,16 @@
|
|||||||
.cell {
|
.cell {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
|
||||||
background-color: var(--base100);
|
background-color: var(--base100);
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hour {
|
.hour {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: var(--font-color300);
|
color: var(--font-color300);
|
||||||
background-color: transparent;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { format } from 'date-fns';
|
import { format, startOfDay, addHours } from 'date-fns';
|
||||||
import { useLocale, useMessages, useWebsiteSessionsWeekly } from 'components/hooks';
|
import { useLocale, useMessages, useWebsiteSessionsWeekly } from 'components/hooks';
|
||||||
import { LoadingPanel } from 'components/common/LoadingPanel';
|
import { LoadingPanel } from 'components/common/LoadingPanel';
|
||||||
import { getDayOfWeekAsDate } from 'lib/date';
|
import { getDayOfWeekAsDate } from 'lib/date';
|
||||||
@ -40,9 +40,10 @@ export function SessionsWeekly({ websiteId }: { websiteId: string }) {
|
|||||||
{Array(24)
|
{Array(24)
|
||||||
.fill(null)
|
.fill(null)
|
||||||
.map((_, i) => {
|
.map((_, i) => {
|
||||||
|
const label = format(addHours(startOfDay(new Date()), i), 'haaa');
|
||||||
return (
|
return (
|
||||||
<div key={i} className={classNames(styles.cell, styles.hour)}>
|
<div key={i} className={styles.hour}>
|
||||||
{i.toString().padStart(2, '0')}
|
{label}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user