Skip to content

Contest Create/Edit Page #83

@adwait-thattey

Description

@adwait-thattey

Use the material date-time picker for selecting the start and end date/time of contest.

U need to get the id of the field that django is rendering, then remove the fields and put the same ID in custom material fields

To change the format of material date and timepicker, use this code snippet while initilizing the fields

        document.addEventListener('DOMContentLoaded', function() {
               var elems = document.querySelectorAll('.datepicker');
                options = {
                     "format": "yyyy-mm-dd"
                }
                var instances = M.Datepicker.init(elems, options);
       });


        document.addEventListener('DOMContentLoaded', function() {
                  var elems = document.querySelectorAll('.timepicker');

                  options = {
                          "twelveHour": false
                   }
                    var instances = M.Timepicker.init(elems, options);
         });

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions