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

**URL:** <https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023>\
**Category:** Contribution\
**Created:** [April 4, 2024, 11:02pm UTC](https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023 "2024-04-04T23:02:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![yannbourdeau](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/yannbourdeau/32/2309_2.png) [@yannbourdeau](https://community.taiga.io/u/yannbourdeau)\
**Post date:** [April 4, 2024, 11:02pm UTC](https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023/1 "2024-04-04T23:02:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![juanfran](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/juanfran/32/290_2.png) [@juanfran](https://community.taiga.io/u/juanfran)\
**Post date:** [April 5, 2024, 12:57pm UTC](https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023/2 "2024-04-05T12:57:37Z")

</div>

If you’re already familiar with JavaScript, learning CoffeeScript should be relatively straightforward. I think the official docs are good enough, [https://coffeescript.org](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](https://github.com/kaleidos-ventures/taiga-front/blob/1f5f524e273edef2d205d5f15b2bd5f6041906b9/app/partials/common/lightbox/lightbox-due-date.jade)

Coffeescript: [taiga-front/app/coffee/modules/common/lightboxes.coffee at 72f80118468f6075c3db4f9c2c3228692aa042a2 · taigaio/taiga-front · GitHub](https://github.com/taigaio/taiga-front/blob/72f80118468f6075c3db4f9c2c3228692aa042a2/app/coffee/modules/common/lightboxes.coffee#L440)

and this CoffeeScript file [taiga-front/app/coffee/modules/common/lightboxes.coffee at 72f80118468f6075c3db4f9c2c3228692aa042a2 · taigaio/taiga-front · GitHub](https://github.com/taigaio/taiga-front/blob/72f80118468f6075c3db4f9c2c3228692aa042a2/app/coffee/modules/common/lightboxes.coffee#L440)

Do you need any indication about the backend?

---

<div class="post-metadata">

**Author:** ![yannbourdeau](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/yannbourdeau/32/2309_2.png) [@yannbourdeau](https://community.taiga.io/u/yannbourdeau)\
**Post date:** [April 5, 2024, 10:04pm UTC](https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023/3 "2024-04-05T22:04:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![david.barragan](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/david.barragan/32/293_2.png) [@david.barragan](https://community.taiga.io/u/david.barragan)\
**Post date:** [April 8, 2024, 9:11am UTC](https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023/4 "2024-04-08T09:11:44Z")

</div>

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](https://docs.djangoproject.com/en/5.0/topics/migrations/)

Best regards

---

<div class="post-metadata">

**Author:** ![yannbourdeau](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/yannbourdeau/32/2309_2.png) [@yannbourdeau](https://community.taiga.io/u/yannbourdeau)\
**Post date:** [April 11, 2024, 9:56pm UTC](https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023/5 "2024-04-11T21:56:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![yannbourdeau](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/yannbourdeau/32/2309_2.png) [@yannbourdeau](https://community.taiga.io/u/yannbourdeau)\
**Post date:** [May 18, 2024, 12:49pm UTC](https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023/6 "2024-05-18T12:49:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![juanfran](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/juanfran/32/290_2.png) [@juanfran](https://community.taiga.io/u/juanfran)\
**Post date:** [May 21, 2024, 7:43am UTC](https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023/7 "2024-05-21T07:43:35Z")

</div>

Our lightbox implementation is custom-built, we don’t use an external library for it. For date selection, we use [pikaday](https://github.com/Pikaday/Pikaday), which does not support time selection. Probably you’ll need to create a separate field for time. Integrating these fields in `lightboxes.coffee` to generate a timestamp with timezone looks like is a good approach.

---

<div class="post-metadata">

**Author:** ![david.barragan](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/david.barragan/32/293_2.png) [@david.barragan](https://community.taiga.io/u/david.barragan)\
**Post date:** [May 28, 2024, 7:26am UTC](https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023/8 "2024-05-28T07:26:23Z")

</div>

Hi @yannbourdeau

If I remember correctly, Taiga uses UTC for datetimes. For example you can see the values that are used for the fields created\_date, modified\_date or finished\_date, for example. The module `django.utils.timezone` has useful functions to works with datetime and this could help you too [Time zones | Django documentation | Django](https://docs.djangoproject.com/en/3.0/topics/i18n/timezones/)

The taiga API works in UTC, so the frontend can display the time based on each person’s browser.

The migration would have to modify the existing due date fields to make sense. Currently, the due date refers to the end of a day. Therefore, since it will default to 00:00:00.000Z, I think it would make more sense to use 23:59:59.000Z to refer to the end of the day. You can use [RunPython()](https://docs.djangoproject.com/en/5.0/ref/migration-operations/#runpython) for this.

I hope this can help

---

<div class="post-metadata">

**Author:** ![yannbourdeau](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/yannbourdeau/32/2309_2.png) [@yannbourdeau](https://community.taiga.io/u/yannbourdeau)\
**Post date:** [July 13, 2024, 12:59am UTC](https://community.taiga.io/t/how-do-i-proceed-add-time-hour-to-due-date/3023/9 "2024-07-13T00:59:18Z")

</div>

Hi there,

been a little while since I have updated on my progress. I have implemented a date time picker (flatpickr) on the add task page. See =\>

 ![add-task-datetime](https://europe1.discourse-cdn.com/flex017/uploads/taiga/original/2X/a/a998f02181cb1cd09c63a8cde1305b8b91352bb7.jpeg)

However, I have broken the modify panel from there =\>

 ![task-modify-datetime](https://europe1.discourse-cdn.com/flex017/uploads/taiga/original/2X/6/6c20f4f0322816ecb013a1a8604190fbd2450c62.jpeg)

The broken panel:

 ![modify-task-datetime-input](https://europe1.discourse-cdn.com/flex017/uploads/taiga/original/2X/0/092fc603ff1ecc3dfdda216b2ab6b9188a798939.jpeg)

I don’t understand how this panel work for the due date. Can someone explain it?

thanks in advance
