Are there libraries available to render a calendar in a Phoenix template? I’m looking for something that I can pass a number of models to and have it render a calendar template with those models based on some
end_date attributes. Something like day view, week view, and month view would be nice.
I looked around, but I only found calendar and date/time related libraries. So, before I reinvent the wheel, does anyone know of something available? Of course, I can do this with a frontend lib, but I’m not sure it’s worth the hasel.
This is very much a front-end problem.
What makes the problem of showing input fields for dates and times difficult is that there exist so many different standards for entering this information. For instance, in the EU we commonly write
dd/mm/yyyy, while in america,
mm/dd/yyyy is used. The international ISO8601 standard is
yyyy-mm-dd which 'should resolve this. But of course, when introducing new standards…
You are definitely not the only developer looking for something like this. But as this is a very application-specific problem, and in any case is not something that is part of Phoenix’ back-end, there indeed do not exist any Hex.pm packages providing such features.
@OvermindDL1 @Qqwy I think I might not have explained myself well. I’m not looking for a date picker. I’m looking to render a calendar on the page and display events on it (as per the example link I gave). The two are similar, but not exactly the same. Although, I do agree with you: This is definitely a frontend issue. But I don’t see a problem with writing a helper that can render a calendar server side, with events, and send it back to the browser as an HTML… just like any other template?
In Rails we had several solutions. I assumed someone might have had the need and wrote something to avoid using frontend/js frameworks. But it’s unlikely given how young our ecosystem is. Thanks for chipping in, and for the helpful explanations–I appreciate them.
Hi there! I’m looking for the exact same thing – calendar template. Just wanted to ask how you did it or if you were able to find a library.
Eh, I’m just rendering it into a table as of recent, pretty basic but it works… ^.^;