Metadata with hyphens?!

I am exploring the use of Fantasy Calendar as a way of keeping events in Obsidian. FC uses the following metadata:
fc-calendar - to identify which calendar the event appears in
fc-date - the starting date of the event
fc-end - thed end date of the event

I’m trying to use dataviewjs to create a list or a table that will show upcoming events. But no matter what I try, the metadata with a ‘hyphen’ seems to not be accessible.

For example:

	dv.table(["Event","Date","Project"],
	dv.pages('"Notes"')
	.where(t=>t.type == "event")
	.map(t=>[t.file.link,t.fc-date,t.project])
	)

Results in Evaluation Error: ReferenceError: date is not defined

Is there a way to use YAML metadata that includes a hyphen?

Thanks

The issue is that if metadata fields are not valid Javascript variable names you will have to use t['fc-date'] instead of t.fc-date in that code.

Thank you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.