Answer the question
In order to leave comments, you need to log in
How to implement a work schedule in Django?
Good afternoon.
It is required to make a fillable work schedule.
On each day of the week, the user chooses from what to what time he works.
Please tell me how to implement the time selection from the list with an accuracy of half an hour.
So far, only the thought of making Choices with a lot of elements came to my mind, but I would like something more elegant.
Answer the question
In order to leave comments, you need to log in
Use a ready-made JS solution. Here is one of the first found:
arshaw.com/fullcalendar (Switch to Day from the top right)
If you need full integration into Django, do it by analogy with djbook.ru/examples/12
In a TextField I store an object of the type serialized in JSON:
[{"start":"09:00","end":"14:00","lunch_start":"","lunch_end":""},
{"start":"09:00","end":"18:00","lunch_start":"13:00","lunch_end":"14:00"},
{"start":"09:00","end":"18:00","lunch_start":"13:00","lunch_end":"14:00"},
{"start":"09:00","end":"18:00","lunch_start":"13:00","lunch_end":"14:00"},
{"start":"09:00","end":"18:00","lunch_start":"13:00","lunch_end":"14:00"},
{"start":"09:00","end":"14:00","lunch_start":"","lunch_end":""},
{"start":"","end":"","lunch_start":"","lunch_end":""}]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question