Render main calendar in-line with a note with Dataview #362
Replies: 14 comments
-
I was looking at this as well -- I really want to be able to specify the view for "today's events" in my daily note and connect them to todo's etc. From my reading of the code, it looks like there are some functions in https://github.com/davish/obsidian-full-calendar/blob/main/src/view.ts in @davish is this something you've been thinking about? Would a pull request toward this be helpful, or just get in the way? |
Beta Was this translation helpful? Give feedback.
-
This is a great feature request! And it won't be that hard, as @matthewturk mentioned. @matthewturk If you want to take a stab at this, please go ahead! |
Beta Was this translation helpful? Give feedback.
-
I came here to suggest the 'todays events' feature as well!! This would be truly fantastic |
Beta Was this translation helpful? Give feedback.
-
I came across this issue by chance, but this is something I have managed to implement by myself with the plug-in as it is. Here you can see the code that I have in my daily notes template: this.container.style.minHeight = "1000px";
const { renderCalendar } = app.plugins.plugins["obsidian-full-calendar"];
let rawData = await dv.pages('"local_calendar"').where(p => p.date = dv.date("{{date:YYYY-MM-DD}}"));
let entries = rawData.map((p) => ({
allDay: p.allDay,
start: DateTime.fromISO(p.startTime).toJSDate(),
end: DateTime.fromISO(p.endTime).toJSDate(),
title: p.title,
id: p.path
}));
let isMobile = window.innerWidth < 500;
let calendar = renderCalendar(this.container, [entries.array()]);
calendar.render(); See that '"local_calendar"' is the folder where your local calendar should be stored. The pv.pages() pulls a list of all notes in that folder, which are event notes. The .where argument filters by day, and here the baseline template plugin functionality comes into place. Then it is just a matter of parsing the information that's already available in the metadata of the notes as an event for the dataview integration to parse. In this way I see in my daily note my daily schedule without distractions. I took inspiration from here: https://forum.obsidian.md/t/custom-full-calendar-with-dataview/34133 I hope this is indeed what the discussion was about and I didn't misunderstand the petition. Let me know what you think :) |
Beta Was this translation helpful? Give feedback.
-
thanks and it is great, but i have multiple calendars including ics links (Google/MS365 calendars). but this is of great help. |
Beta Was this translation helpful? Give feedback.
-
I want to further say this would be great! Adding the functionality of today's events to my daily note would make this perfect! |
Beta Was this translation helpful? Give feedback.
-
For anyone interested, there's a Dataview integration session in the doc. This dataview integration is utterly amazing! I switched from Day Planner to this plugin because I really like the weekly and monthly overview. However, one big problem for me is that it's No hurries however! Two-pane view makes me even more mindful and conscious about how the day goes by. Thank you again for such an amazing plugin! |
Beta Was this translation helpful? Give feedback.
-
+1 on that. Especially with the introduction of canvas, embedding editable full-calendar views in notes would be amazing. |
Beta Was this translation helpful? Give feedback.
-
Great embed code @agfaur - for whatever reason this is not working for me... Any ideas where I could be going wrong? I have only changed "local-calendar" to "event-notes" where my events are stored locally... |
Beta Was this translation helpful? Give feedback.
-
Hi All, For anyone else who had the same issue as me, I asked on the Dataview channel on the Obsidian Discord and Krakor gave the below wonderful solution. You should delete the const entries = rawData.map((p) => {
const startTime = p.startTime.split(':')
const endTime = p.endTime.split(':')
const start = dv.luxon.DateTime.fromObject({ ...p.date.c, hour: startTime[0], minute: startTime[1] })
const end = dv.luxon.DateTime.fromObject({ ...p.date.c, hour: endTime[0], minute: endTime[1] })
const {title, allDay, completed} = p
return {
title,
allDay,
completed,
start: start.toString(),
end: end.toString(),
};
}); |
Beta Was this translation helpful? Give feedback.
-
I'm sorry for my inactivity, I have not used this in a while... but indeed, my original code was working only partially, I changed it after a while to something very similar to what you're showing, @awsharif. However I stopped embedding the calendar in my daily notes because I ended up finding them too cluttered like that 😄 |
Beta Was this translation helpful? Give feedback.
-
Did anyone make any progress on getting all of the calendars defined in the Full Calendar instance which is configured in Obsidian? (i.e showing google calendar ics & iCloud calendar events in a dataview) |
Beta Was this translation helpful? Give feedback.
-
So as it stands right now is there any way to render a remote calendar (caldav) into a note? Trying to do what others above are trying and put into my daily note. |
Beta Was this translation helpful? Give feedback.
-
I'm looking at this particular feature as well for ma daily-note template. Any update ? |
Beta Was this translation helpful? Give feedback.
-
The dataview example you gave gets the items passed to renderCalendar, but I'd like to be able to get access to / display the calendar that I've set up in a "container" so I can embed in a note. Can you give an example of how to do this and possibly customize the display (start in day/week view, get a specific week, etc)
Beta Was this translation helpful? Give feedback.
All reactions