How do I proceed: Add time(hour) to due date

Hi there,

A couple of weeks ago, I asked if a time(hour) period were supported for the due date or if there is any plan to support it. The response was negative and I have volunteered to do it. For now, i have checkout taiga-back and taiga-front on an Ubuntu 22.04 ARM (in a VM on an apple silicon mac) (had issue with 20.04 arm with VMWare support) and it is working.
I’m pretty familiar with Python but never touched Django. I seen that the front end is coded in coffee script and I’m only familiar with pure Javascript and Angular. Is there a good tutorial on Coffeescript somewhere? I’m familiar with Postgresql.
I’d like to know how to proceed with this feature? It may take a long time because I’ll be working only on it on the weekend. I have a full time job as a software developer that take most of my time. It is the first time that I’ll be contributing to an opensource project.

Thanks in advance

2 Likes

If you’re already familiar with JavaScript, learning CoffeeScript should be relatively straightforward. I think the official docs are good enough, https://coffeescript.org.

To incorporate a new field into the existing lightbox, you will need to modify the HTML and CoffeeScript files.

HTML: taiga-front/app/partials/common/lightbox/lightbox-due-date.jade at 1f5f524e273edef2d205d5f15b2bd5f6041906b9 · taigaio/taiga-front · GitHub

Coffeescript: taiga-front/app/coffee/modules/common/lightboxes.coffee at 72f80118468f6075c3db4f9c2c3228692aa042a2 · taigaio/taiga-front · GitHub

and this CoffeeScript file taiga-front/app/coffee/modules/common/lightboxes.coffee at 72f80118468f6075c3db4f9c2c3228692aa042a2 · taigaio/taiga-front · GitHub

Do you need any indication about the backend?

1 Like

Thanks JuanFran,

I did not search for it but is there an upgrade database scripts or tools used to update the schema definition of the database?

The more I’ll look at the code, the more I will have question. This is the appropriate place to ask my question?

I’ll look at the code this weekend.

Thanks

Hi @yannbourdeau

The Taiga backend uses Django. There are migrations that are generated after modifying the models. You can find more help at Migrations | Django documentation | Django

Best regards

thanks for the info. I’ll start slowly over the coming weeked to do a plan omn how to do it. In a month, I have 3 weeks off and I plan to complete the modification in this period. I don’t have much time with my full time job.

Hi @juanfran and @david.barragan,

I have started working on this yesterday.

First for the backend. I have modified DueDateMixin class to change the due_date field to a DateTimeField. This will hit the user stories, issues and tasks. Is that OK ? Or you want me to just to target the task for this change ?
Another question, Django has created the migration script to upgrade the database. However, do I need to add a manual conversion of the old field format (DateField) to new field Format(DateTimeField) to not lose data in the upgrade ? The field in the database is now a timestamp with timezone. I was surprised that it was not in UTC. Is the time saved in UTC ? My Taïga installation has users around the world and the due date time must appear in their converted local time zone.

Now, for the frontend. I have read a book on coffescript. I must say, I’m a bit of a little lost. I’m used to using javascript library for datetime picker and it seems the datetime seems to be related Lightbox. Kagi search returned me a library to show pictures. Is lightbox homemade, or is it a third party ?

Me second question, do I need to do two fields in lightbox one to do the date and another one to do the time ? I’m not sure of the best way to proceed. Again, I’m used to using a datetime picker. I could combine the two fields in lightboxes.coffee (the second link) to generate a timestamp with timezone.

By the way, your third and second link in your reply are the same.

Thanks in advance