Form - Select: how to dynamically add options in the frontend?

I’m currently designing a page to register for some events. For each event there are multiple dates. For each Event i have a file with the corresponding events.
I already got a page for each event that grabs the available dates from the file, now i want to create a form so that people can register for the date they want. How can i get grav to create a select field with the corresponding options without having to enter them myself?
I tried writing a plugin with a simple function and having the select field “data-options@:” value call that function. As i did not know if my plugin or my function call was wrong I tried it with an existing function:
data-options@: '\Grav\Common\Utils::dateFormats’
still the select field does not get populated.
What am i doing wrong?
Is it maybe possible to edit it with twig in the page?
(as in somewhat like set field.options = whatever) ?

2 Likes