How can I make a Calendar?

I have been looking for a pre-built inventory check-out solution for internal employees, but haven’t found one that meets our needs. Most are too complex, and have too many features we will never use which (only will confuse users). I am hoping to create a simple solution using Anvil!

Example scenario: An employee needs to check-out a laptop next month to use for one week.

How could I display a calendar that will show when this item has been “reserved” so it is clear no one else can check out this item during that week?

We need the user to visually see when things are unavailable at a glance; opposed to something like, selecting the dates they want and then be told afterwards it is booked during that period.

We also need to be able to scroll through the year to see when different items are going to be, or have been, reserved in the future/past.

Hoping this is possible, thanks in advance!

1 Like

I think the Python calendar module will make your life a lot easier here - it’s available in Server Modules.

In order to display the days, you can construct a Custom Component with a label to display the date. It could contain a Repeating Panel that itself has the inventory for that day in it (each item could be a link that opens a new Form for the details of that item).

Here’s a starting point I put together - it constructs a grid of days for a given month in a Grid Panel, with a button for changing month (it’s restricted to 2018 but it’s easy make the year settable.)

I chose a Grid Panel to lay out the days, but you could also try using a Data Grid - that would give you the pagination for free and might generally be nice and elegant.

Feel free to clone it and use any parts of it you find helpful.

https://anvil.works/build#clone:2MVUNGBCXXRTEMBU=AHHXLVWXKYVHWYKXZSHHPUBS

10 Likes

Shaun, I can’t thank you enough for the extremely helpful, thorough, and lighting fast response! This looks fantastic, I went ahead and cloned it and will start digging into it!

3 Likes

Awesome! Just what I was looking for. Thanks!

1 Like