mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
faster calendar attributes calculation
This commit is contained in:
parent
78b2a3e673
commit
0433352d21
1 changed files with 1 additions and 3 deletions
|
@ -1,13 +1,11 @@
|
|||
import dayjs from 'dayjs'
|
||||
|
||||
export function attributesFromEvents(_events) {
|
||||
|
||||
// const colors = ['teal', 'green', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray']
|
||||
// merge events with same date
|
||||
let attributes = []
|
||||
const now = dayjs().unix()
|
||||
for (let e of _events) {
|
||||
const key = dayjs.unix(e.start_datetime).tz().format('YYYYMMDD')
|
||||
const key = Math.floor(e.start_datetime/(3600*24)) // dayjs.unix(e.start_datetime).tz().format('YYYYMMDD')
|
||||
const c = (e.end_datetime || e.start_datetime) < now ? 'vc-past' : ''
|
||||
|
||||
if (e.multidate) {
|
||||
|
|
Loading…
Reference in a new issue