Closed helleholmsen closed 3 years ago
Never mind! I just noticed I can access this with fieldHandle.start
and fieldHandle.end
:)
Cheers @helleholmsen, happy to see you found it! Feel free to make a new issue if you run into anything else :)
@janhenckens thanks! 🎉
Sorry to reopen this issue, I am having trouble accessing the start and end values of my date range field. I am trying to output dates as follows: 01 Apr - 09 June 2024 - in this scenario ideally the year would only output once if it is the same year. I am hoping that by accessing the start and end values I can compare the year but I'm not having any luck and just keep getting errors, so I am definitely using it wrong!
I was initially using {% set dates = event.dates.formatted("j M Y") %}
to format the dates appropriately, but the main issue is only outputting the year once if they match.
Any help on this would be greatly appreciated.
@gracehcoote you could use event.dates.start
and event.dates.end
, that way you can write your own logic to set the correct formats when you need them.
Hi! I need the start and end-date as seperate date objects. Is this possible?
I'm using the craft3-calendarlinks plugin to generate isc links and there you need to have a from and to date fields like this: