Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 104 commits into
base: master
Choose a base branch
from

Commits on May 7, 2024

  1. [frontend/tasksets] Changing course accessibility init structure

    Adding an "accessible_period" dict to define start and end period.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    2a24526 View commit details
    Browse the repository at this point in the history
  2. [frontend/accessible_time] Changing AccessibleTime to new course/task…

    … accessibility and registration
    
    Courses will now use a dictionnary for "accessible_period" and "registration_period" with a start and end element. Tasks will have an "accessibility_period" dict with an extra soft_end element.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    78449e8 View commit details
    Browse the repository at this point in the history
  3. [frontend/course_admin] Adapting course settings form to new course a…

    …ccessibility/registration structure
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    d8e22f8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ae87e9d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5f95381 View commit details
    Browse the repository at this point in the history
  6. [frontend] Changing task accessibility data structure

    Putting boolean and period dict inside one element : "accessibility": {"is_open": bool, "period": {"start": ..., "soft_end": ..., "end": ...}}. This way dispenser_data["config"] init in TableOfContents does not have to be changed.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    3437e2e View commit details
    Browse the repository at this point in the history
  7. [frontend] changing course acces and registration structure in yaml a…

    …nd DB
    
    To keep the same structure as the task accessibility (dict with bool and period dict).
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    98e8396 View commit details
    Browse the repository at this point in the history
  8. [frontend/toc] fixing dates transformation before rendering toc.html

    When initiating task_config from yaml we give a default value if there are missing values. When these values are dictionnaries they are actually all the same. Modifying one will modify all of them. Therefor we give an new instance at each default value to allow transformation into strings before rendering.  Also had a mixup on the transformation itself.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    18a8daf View commit details
    Browse the repository at this point in the history
  9. [frontend] Storing dates in yaml files as datetime objects

    Adding representer to use !!timestamp tag in yaml for datetime objects. Moving string transformation in datetime before changing taskset yaml file. Fixing datetime transformation to datetime before toc.html render (was permanently changing task_config).
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    7ae3a78 View commit details
    Browse the repository at this point in the history
  10. [frontend/accessible_time] Changing AccessibleTime init structure

    Structure made in previous commits was not valid due to the way other method of this class work. Values for the dates could be None. Resulting in errors when comparing NoneType and datetime objects.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    0340138 View commit details
    Browse the repository at this point in the history
  11. [frontend] Storing datetime to string and the opposite in util files

    Plus fixing bug : When deleting tasks in course edit, the missing tasks were added back (check_dispenser_data function) with default parameters. Default date parameter beeing None it wasn't correctly handled by the date conversion (dispenser_data_str_to_datetimes function).
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    96231dd View commit details
    Browse the repository at this point in the history
  12. [frontend] Adapting combinatory test to new AccessibleTime structure

    + fixing dispenser_config not passed to render
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    fa0750a View commit details
    Browse the repository at this point in the history
  13. [frontend] Changing datetime to str and opposite

    Changing their name and structure to allow transformation of strings and dates inside python list.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    f9aee73 View commit details
    Browse the repository at this point in the history
  14. [frontend/task_dispenser_admin] Allowing string dates in AccessibleTi…

    …me for use in templates
    
    Was setting up AccessibleTime to use datetime objects for the period dates. But in the templates the task_config is parsed in JSON and it can't parse datetime objects. So whe transform the dates into strings before render. AccessibleTime needs to be able to handle string dates because of it's use in the templates.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    9c0473d View commit details
    Browse the repository at this point in the history
  15. [frontend/task_dispenser] Adapting Accessibility.get_value() to legac…

    …y settings from task yaml
    
    Was checking the accessibility settings as they were using the new structure (in DB or taskset.yaml). But when checking if the tasks have legacy settings in their task.yaml it raises an exception because the legacy accessibility has the old structure.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    0df58a4 View commit details
    Browse the repository at this point in the history
  16. Â[frontend] Remove boolean from access data structure

    The boolean "is_open" is not really used. Instead we now only use the start, soft_end and end date. We will differenciate the access types by setting some dates to a minimal or maximal value. For example : a task that is always open will have a minimal start date and maximal soft_end and end dates.
    In the custom acces mode, the dates are now optional. You can for example set an end date without setting a start date because it will automatically be set to the minimal value.
    
    The dates are stored in MongoDB as ISODate() objects and we will use datetime.min and datetime.max in python code for minimal and maximal values. However, MongoDB stores dates with a precision to the millisecond. Datetime objects have a precision to the nanosecond. Therefor we have some transformations when retrieving dates from mongoDB (in AccessibleTime).
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    1c7ba27 View commit details
    Browse the repository at this point in the history
  17. [common/custom_yaml] Changing timestamp representer to correctly tran…

    …sform minimal date
    
    When using the timestamp representer to transform datetime objects into strings with "!!timestamp" tags, the date.min caused problems. The zeros in front of the 1 (0001-01-01 00:00:00) would not be considered when using datetime.strftime(). It would simply delete the zeros causing the date to not have the correct structure for the timestamp.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    2340aea View commit details
    Browse the repository at this point in the history
  18. [frontend/accessibility.html] Fix error occuring when changing date o…

    …n already custom accessibility
    
    When changing a task accessibility (soft_end or end) that was already custom an error occured when saving the changes. It was because there was no check if the input value is an empty string.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    fd25ba3 View commit details
    Browse the repository at this point in the history
  19. [frontend] Fixing max date milliseconds not written in yaml and DB

    dict_data_str_to_datetime was not operating correctly because the strings were already transformed in datetime objects when checking for the data. Adapted AccessibleTime parse_date() and not using dict_data_str_to_datetime anymore.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    ed56453 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    19c0500 View commit details
    Browse the repository at this point in the history
  21. [frontend] Changing accessible and registration structure when import…

    …ing legacy courses
    
    + moving dict_data_str_to_datetime()
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    a789634 View commit details
    Browse the repository at this point in the history
  22. [frontend] Changing task access structure during imports in task_disp…

    …enser
    
    Changing access structure of tasks when importing in course template and task edit. Also moving change_access_structure, dict_data_str_to_datetime and dict_data_datetimes_to_str in util file in frontend directory.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    6ea6b02 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    0fe5ec1 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    1d50870 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    7a7d03f View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    7a6b750 View commit details
    Browse the repository at this point in the history
  27. cleaning for PR

    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    39ce930 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    0998b0b View commit details
    Browse the repository at this point in the history
  29. [frontend/accessibility] Fixing datetime picker cleaning during modal…

    … feed
    
    Fixing previous commit
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    96b2446 View commit details
    Browse the repository at this point in the history
  30. [frontend/contest] Fixing constest plugin with new database date format

    + course_factory method used on taskset_factory
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    d25e5a0 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    ea4df4e View commit details
    Browse the repository at this point in the history
  32. [frontend] Indicating a four digit year when transforming datetimes i…

    …nto strings
    
    Had years with less than 4 digits not transformed into strings with years without leading "0" characters.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    c6685c3 View commit details
    Browse the repository at this point in the history
  33. [custom_yaml] refactoring formatting for datetime yaml representer

    Simplifying 4 digit year check + removing empty string check because can only be applied to datetime objects
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    9b5416d View commit details
    Browse the repository at this point in the history
  34. [frontend] Remove min and max hardcoded dates + storing without micro…

    …seconds
    
    Storing as min and max attributes of AccessibleTime when possible. And using dates without microseconds
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    9395f96 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    26867c7 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    085fef4 View commit details
    Browse the repository at this point in the history
  37. [frontend/accessible_time] Fixing legacy structure support

    by adding boolean, empty string and None values
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    f1a3f4c View commit details
    Browse the repository at this point in the history
  38. [frontend/accessible_time] Adapting course accessibility when no regi…

    …stration date
    
    + fix None value and empty string
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    96b0d45 View commit details
    Browse the repository at this point in the history
  39. [frontend/settings] Changing course accessibility structure when upda…

    …ting settings instead of legacy migration
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    d56d8fd View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    4f7f40a View commit details
    Browse the repository at this point in the history
  41. Revert "[frontend/task_list] Moving task access structure update to l…

    …egacy update"
    
    This reverts commit d03a4e9.
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    b615b92 View commit details
    Browse the repository at this point in the history
  42. [frontend/task_dispenser] Updating task accessibility structure when …

    …tasks settings update
    
    Previously done when importing legacy tasks
    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    26e0658 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    5776d6e View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    ca8e595 View commit details
    Browse the repository at this point in the history
  45. Fix codacy warning

    AlexandreDoneux committed May 7, 2024
    Configuration menu
    Copy the full SHA
    dafa720 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. Configuration menu
    Copy the full SHA
    1a88ba2 View commit details
    Browse the repository at this point in the history
  2. [frontend] Fixing forgotten code that needed to be removed

    for removing accessibility structure from task import
    AlexandreDoneux committed May 16, 2024
    Configuration menu
    Copy the full SHA
    42811b0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fed730d View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. Configuration menu
    Copy the full SHA
    05daaf2 View commit details
    Browse the repository at this point in the history
  2. [frontend] Adapting combinatory test to new AccessibleTime structure

    + fixing dispenser_config not passed to render
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    02937c1 View commit details
    Browse the repository at this point in the history
  3. [frontend/task_dispenser_admin] Allowing string dates in AccessibleTi…

    …me for use in templates
    
    Was setting up AccessibleTime to use datetime objects for the period dates. But in the templates the task_config is parsed in JSON and it can't parse datetime objects. So whe transform the dates into strings before render. AccessibleTime needs to be able to handle string dates because of it's use in the templates.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    672f4a0 View commit details
    Browse the repository at this point in the history
  4. Adding moment.js locales and moment-timezone.js

    Locales were not working for datetimepickers because the loacales were not defined. moment-with-locales.min.js contains those locales.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    71515f6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    772a5d3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    31c63d5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8d2b22c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6b57cf4 View commit details
    Browse the repository at this point in the history
  9. [frontend] Adding timeZone to last datetimepickers

    Had a problem when retrieving taskid in accessibility.html. It is passed to the button on the opening of the modal. However they are two events triggered by that opening. The one where defaultDate are given to the datetimepicker triggers first. And the change in value triggers another event using taskid. Therefor taskid wass accessed before being passed as data.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    1a5218c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    974aa11 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f29900e View commit details
    Browse the repository at this point in the history
  12. [frontend/course_admin] Adding reverse timezone transformation before…

    … form submit
    
    Before submitting the form the dates in datetime pickers are transformed from the user's timezone to UTC (timezone used for the server dates).
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    ae61c79 View commit details
    Browse the repository at this point in the history
  13. [frontend/accessible_time] Using UTC dates during accessibility check

    Indicating the dates received are UTC and retrieving UTC datetime.now() for correct comparison.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    be4cc2a View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    4b6fc17 View commit details
    Browse the repository at this point in the history
  15. [frontend/accessibility] Fixing taskid use in accessibility.html

    Error previously fixed on access_tructure branch but reapeared due to bad rebase.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    352f3e1 View commit details
    Browse the repository at this point in the history
  16. [frontend/accessibility] Applying timezone to task accessibility edit

    Because the modal is only one HTML code block we update with new data, datetime pickers need to be destroyed are recreated with the new defaultDate. This is the only option found to apply the timezone. Changing the date with datetimepicker('date', ...) does not take timezone into consideration.
    
    Recreating the datetime picker triggers the change event listeners. Added a 'ignore-change' value to pickers to avoid updating the dispenser_config on modal feed.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    32f366f View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    13411ad View commit details
    Browse the repository at this point in the history
  18. [frontend/accessibility] Fixing grouped custom edit changes without c…

    …hecking custom
    
    During grouped edit one could select dates and apply the changes without selecting the "custom" radio check.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    62b6258 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    9de79ca View commit details
    Browse the repository at this point in the history
  20. [frontend/settings] Fixing empty datetime picker sends creation date

    When using viewDate to retrieve date on empty picker it sent the creation date of that picker. Using date instead.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    2537a09 View commit details
    Browse the repository at this point in the history
  21. [frontend/accessibility] Changing 'date' picker option instead of des…

    …troying each time it needs change
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    590ddff View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    e855325 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    5af386a View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    270f834 View commit details
    Browse the repository at this point in the history
  25. [frontend/accessibility] Adapting accessibility feed and individual c…

    …hange datetime pickers to Flatpickr
    
    Managed to delete event listeners on individual date pickers. Contrary to Tempus Dominus. The change through picker and through input change are both triggered by one event listener.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    f763c67 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    15d1def View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    7b386dc View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    b8cfd82 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    ffb9151 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    9e2a37b View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    e65edd7 View commit details
    Browse the repository at this point in the history
  32. [frontend/upcoming_tasks] Fixing outdated tasks and course method cal…

    …led on taskset object
    
    We were storing still open courses as they were already past due.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    ce0959e View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    d630f82 View commit details
    Browse the repository at this point in the history
  34. [frontend/statistics] Fixing missing timezone in datetime key

    Using datetime objects as dictionnary keys will change depending on if a timezone was given. If a timezone is given the key will have an offset in addition to the date and time. In our case, adding the utc timezone to the c key solves the problem.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    b6b5fb0 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    07cbe29 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    7379c7b View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    23bfd63 View commit details
    Browse the repository at this point in the history
  38. [frontend] Fixing datetime picker default values

    Was transforming moment objects to Javascript Date objects. However these Date objects do not hold timezone data and define the date with a local timezone.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    f081fbd View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    ebda52e View commit details
    Browse the repository at this point in the history
  40. [frontend/scoreboard] Add missing class and timezone attribute to ada…

    …pt scoreboard plugin to user's timezone
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    a007679 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    8949c4a View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    f9d3741 View commit details
    Browse the repository at this point in the history
  43. [frontend] Changing available_datetime_formats structure

    Exchanging keys and values for easier manipulation in html.
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    f181093 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    f3727f5 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    1ff729c View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    a14c18f View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    ae572b6 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    2065f77 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    965af5b View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    ee23a48 View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    1e5ef76 View commit details
    Browse the repository at this point in the history
  52. [frontend/accessible_time] Applying utc timezone directly in parse_da…

    …te() and adapt_database_date()
    
    to fix test_parsable_text tests + fixes (not applying timezone to min and max dates)
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    282a1db View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    d6ea6f5 View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    8ba784c View commit details
    Browse the repository at this point in the history
  55. [frontend/accessibility] Applying utc timezone to min and max and fix…

    … string handling in accessibility.html
    AlexandreDoneux committed May 17, 2024
    Configuration menu
    Copy the full SHA
    6ae1b50 View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    cf2955c View commit details
    Browse the repository at this point in the history