[Done] Calendar module is not yet implemented in Skulpt

Please implement Calendar module in Skulpt.

I’m trying to build a Calendar app, and anytime I need to use functionality from the Calendar module, I have to make calls to the server side, which is sloooow.

Thanks :slight_smile:

1 Like

This probably doesn’t work, but I wonder whether it might be possible to pass a calendar.Calendar object from server to client side via a portable object container. I might give it a try later.

1 Like

Nah, it doesn’t work.

https://anvil.works/build#clone:UD6M4OMSWUOGGRQR=VBYXVRQ3CTA4DNLYOLR3RYFX

This has now been implemented :smile:
It should even support a few languages

>>> import calendar
>>> c = calendar.LocaleTextCalendar(firstweekday=0, locale="fr_FR")
>>> c.prmonth(2022, 1)
    janvier 2022
lu ma me je ve sa di
                1  2
 3  4  5  6  7  8  9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
6 Likes

If I run import calendar in a module on the client side, I get the error:
ModuleNotFoundError: No module named 'calendar'

Do we need to do anything to get this to work now that it has been implemented in skulpt?

@Neeeco it should just work - I don’t see the error when I do the same thing. Maybe you need to do a hard refresh?
Or if still not working then a clone link will help.

Interesting, I’m only experiencing the issue in Microsoft Edge. If I open the IDE in Chrome, the calendar module works on the client side. However, if I open the same in Edge, then I get the error mentioned above.

That’s sounds like a browser cache issue. Have you tried clearing the cache for the page and reloading?

2 Likes

Thanks Anvil team!

I’ll check it out :slight_smile:

1 Like

For anyone struggling with hard refresh in Microsoft Edge in the future, just follow these steps:

  1. Press F12 which will open the developer tools on Microsoft Edge.
  2. With the developer tools open, you can now right click on the refresh button, and select “Empty cache and hard refresh”

Solved the problem for me.

1 Like