Jam.py Date conversion questions

43 views
Skip to first unread message

Manos Pappas

unread,
Sep 6, 2022, 4:06:24 AM9/6/22
to Jam.py Users Mailing List
Hello,

I would like some help with some (stupid) issue I am having with my Jam.py application.

On my Jam.py application, I have several tables with DATETIME and DATE fields.
Suppose we have a field called DateStart of type DATETIME.
I need to access the ISO DATETIME string in order to use it on FullCalendar and other libraries.

Can someone give me a working example? I have tried functions like .toISOString() and Date.Parse() (on the DateStart.display_text string) but nothing works.

Thank you very much in advance for your help.

Best Regards,
Manos

Danijel Kaurin

unread,
Sep 6, 2022, 2:32:51 PM9/6/22
to Manos Pappas, Jam.py Users Mailing List
Manos,

If you want po parse record from db table to be shown in fullCalendar, you can user JS code, not server code. It's easier to work with dates.

Copy item with js, crate json and than use that data in fullCalendar model.

Regards

--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jam-py/a5a1d36b-d215-40cc-ac76-f3d8a1bb4d99n%40googlegroups.com.

Manos Pappas

unread,
Sep 7, 2022, 2:44:38 AM9/7/22
to Jam.py Users Mailing List
Hi,

Thank you for the suggestion. I am using JS, do you have any working example?

Andrew Yushev

unread,
Sep 7, 2022, 6:44:03 AM9/7/22
to Manos Pappas, Jam.py Users Mailing List
Hi, Manos
I tried toISOString function.
It seems to work

image.png

ср, 7 сент. 2022 г. в 09:44, Manos Pappas <front...@gmail.com>:

Manos Pappas

unread,
Sep 7, 2022, 6:50:18 AM9/7/22
to Jam.py Users Mailing List
Thank you Andrew,

I will try to use toISOString() with FullCalendar and will report back my findings.
Message has been deleted

Manos Pappas

unread,
Sep 9, 2022, 1:40:46 AM9/9/22
to Jam.py Users Mailing List
Hello,

One can use the toISOString() to convert a FullCalendar selected Date to the format YYYY-MM-DDTHH:MM:SS which can be used with FullCalendar.

The problem I have now is on setting the converted date (of format YYYY-MM-DDTHH:MM:SS) back to a Jam.py DATETIME field.
I've tried using .value and .display_text but with no avail.

Is there any documentation available regarding Jam.py field types and how to format values in order to accept them?
I cannot find anything about that on pages like this and this.

Manos Pappas

unread,
Sep 9, 2022, 1:59:49 AM9/9/22
to Jam.py Users Mailing List
Sometimes, the most obvious thing is in front of our eyes, yet we do not see it.

item.datetime_field.value = new Date(mydatetime.toISOString());
Reply all
Reply to author
Forward
0 new messages