mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-10 10:57:04 +00:00
Make calendar window smaller to avoid tag limits
This commit is contained in:
@@ -65,7 +65,7 @@
|
|||||||
tags: [
|
tags: [
|
||||||
["d", initialValues?.d || randomId()],
|
["d", initialValues?.d || randomId()],
|
||||||
["title", title],
|
["title", title],
|
||||||
["location", location],
|
["location", location || ""],
|
||||||
["start", start.toString()],
|
["start", start.toString()],
|
||||||
["end", end.toString()],
|
["end", end.toString()],
|
||||||
...daysBetween(start, end).map(D => ["D", D.toString()]),
|
...daysBetween(start, end).map(D => ["D", D.toString()]),
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
int,
|
int,
|
||||||
YEAR,
|
YEAR,
|
||||||
MONTH,
|
DAY,
|
||||||
insert,
|
insert,
|
||||||
sortBy,
|
sortBy,
|
||||||
assoc,
|
assoc,
|
||||||
@@ -203,9 +203,11 @@ export const makeCalendarFeed = ({
|
|||||||
onExhausted?: () => void
|
onExhausted?: () => void
|
||||||
initialEvents?: TrustedEvent[]
|
initialEvents?: TrustedEvent[]
|
||||||
}) => {
|
}) => {
|
||||||
|
const interval = int(5, DAY)
|
||||||
|
|
||||||
let exhaustedScrollers = 0
|
let exhaustedScrollers = 0
|
||||||
let backwardWindow = [now() - MONTH, now()]
|
let backwardWindow = [now() - interval, now()]
|
||||||
let forwardWindow = [now(), now() + MONTH]
|
let forwardWindow = [now(), now() + interval]
|
||||||
|
|
||||||
const getStart = (event: TrustedEvent) => parseInt(getTagValue("start", event.tags) || "")
|
const getStart = (event: TrustedEvent) => parseInt(getTagValue("start", event.tags) || "")
|
||||||
|
|
||||||
@@ -273,7 +275,7 @@ export const makeCalendarFeed = ({
|
|||||||
onScroll: () => {
|
onScroll: () => {
|
||||||
const [since, until] = backwardWindow
|
const [since, until] = backwardWindow
|
||||||
|
|
||||||
backwardWindow = [since - MONTH, since]
|
backwardWindow = [since - interval, since]
|
||||||
|
|
||||||
if (until > now() - int(2, YEAR)) {
|
if (until > now() - int(2, YEAR)) {
|
||||||
loadTimeframe(since, until)
|
loadTimeframe(since, until)
|
||||||
@@ -289,7 +291,7 @@ export const makeCalendarFeed = ({
|
|||||||
onScroll: () => {
|
onScroll: () => {
|
||||||
const [since, until] = forwardWindow
|
const [since, until] = forwardWindow
|
||||||
|
|
||||||
forwardWindow = [until, until + MONTH]
|
forwardWindow = [until, until + interval]
|
||||||
|
|
||||||
if (until < now() + int(2, YEAR)) {
|
if (until < now() + int(2, YEAR)) {
|
||||||
loadTimeframe(since, until)
|
loadTimeframe(since, until)
|
||||||
|
|||||||
Reference in New Issue
Block a user