Replies: 1 comment
-
Hello and welcome to SQLPage ! There is no calendar component built into SQLPage at the moment (but it's something I want to add eventually). You can generate a simple calendar using the card component and your database's datetime functions, though. In postgres, for instance, it would look like this: select 'card' as component, 7 as columns;
WITH days_in_month AS (
SELECT generate_series(
date_trunc('week', date_trunc('month', CURRENT_DATE)),
date_trunc('week', date_trunc('month', CURRENT_DATE) + INTERVAL '1 month' - INTERVAL '1 day'),
INTERVAL '1 day'
)::date AS day
)
SELECT
TO_CHAR(d.day, 'YYYY-MM-DD') AS title,
STRING_AGG(
'- [' || e.title || '](./event.sql?id=' || e.id || ')',
E'\n'
) AS description_md
FROM
days_in_month d
LEFT JOIN
events e ON e.event_date = d.day
GROUP BY
d.day
ORDER BY
d.day; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi folks,
has anyone created a calendar with SQLPage?
Thank
Norbert
Beta Was this translation helpful? Give feedback.
All reactions