UCL-INGI / INGInious

INGInious is a secure and automated exercises assessment platform using your own tests, also providing a pluggable interface with your existing LMS.
http://www.inginious.org
Other
202 stars 139 forks source link

[frontend] Timezone and date format for date display and datetime pickers #988

Open AlexandreDoneux opened 7 months ago

AlexandreDoneux commented 7 months ago

This pull request aims to adapt displayed dates and form date inputs to the users timezone (see #526). This would allow better comprehension over courses accessibility and task deadlines for any users abroad/ in another timezone. Currently the displayed dates are based on the timezone of the machine where the INGInious is deployed.

Thanks to this PR the dates would be stored as UTC without offset and would be adapted on the frontend to whichever timezone the user has selected in their account preferences. Or, if none is selected, to the default timezone of their browser.

TO DO :

This PR is based on PR #985. It will be rebased over time as changes on the base PR appear.

AlexandreDoneux commented 7 months ago

We currently use Tempus Dominus Bootstrap4 v5.0.1 for the datetime pickers. However while adapting it's use to take into account the user's timezone I encountered what seems to be a bug of some sort : Modifying the picker's input a second time does not affect the value retrieved with .datetimepicker.('date').

The more recent versions of Tempus Dominus might fix this but does not support the integrated timezone option anymore. Because of this the date must be transformed before being passed to the picker. This raises the question of updating Tempus Dominus or using anoter picker. I have found this picker that contains date and time selection. It has a better documentation than Tempus Dominus and seems decent.

AlexandreDoneux commented 7 months ago

We currently use Tempus Dominus Bootstrap4 v5.0.1 for the datetime pickers. However while adapting it's use to take into account the user's timezone I encountered what seems to be a bug of some sort : Modifying the picker's input a second time does not affect the value retrieved with .datetimepicker.('date').

The more recent versions of Tempus Dominus might fix this but does not support the integrated timezone option anymore. Because of this the date must be transformed before being passed to the picker. This raises the question of updating Tempus Dominus or using anoter picker. I have found this picker that contains date and time selection. It has a better documentation than Tempus Dominus and seems decent.

AlexandreDoneux commented 7 months ago

Rebase on 69317b14.

AlexandreDoneux commented 6 months ago

Rebase on 4de3a172.

anthonygego commented 5 months ago

I will wait for #985 to be done before reviewing this one.

AlexandreDoneux commented 3 months ago

Rebase on 42811b07.

AlexandreDoneux commented 3 months ago

Rebase on fed730d1.

AlexandreDoneux commented 3 months ago

Rebase on 05daaf2e.