diff options
author | Akshen | 2017-06-22 15:24:26 +0530 |
---|---|---|
committer | Akshen | 2017-06-22 15:24:26 +0530 |
commit | 58268fbf548df26cf5de1a36bfd56e17f154a4c4 (patch) | |
tree | 5524c404080864868f0f2523a7a0a241462b261c /workshop_app | |
parent | 9dde06c3ace0cf5ee0a85b17658486ce73991cba (diff) | |
download | workshop_booking-58268fbf548df26cf5de1a36bfd56e17f154a4c4.tar.gz workshop_booking-58268fbf548df26cf5de1a36bfd56e17f154a4c4.tar.bz2 workshop_booking-58268fbf548df26cf5de1a36bfd56e17f154a4c4.zip |
Sets EndDate time
- Propose Workshop Template
- recurrance fuction call in views.py
Diffstat (limited to 'workshop_app')
-rw-r--r-- | workshop_app/templates/workshop_app/propose_workshop.html | 6 | ||||
-rw-r--r-- | workshop_app/views.py | 19 |
2 files changed, 17 insertions, 8 deletions
diff --git a/workshop_app/templates/workshop_app/propose_workshop.html b/workshop_app/templates/workshop_app/propose_workshop.html index fb4c926..ce90dc8 100644 --- a/workshop_app/templates/workshop_app/propose_workshop.html +++ b/workshop_app/templates/workshop_app/propose_workshop.html @@ -12,13 +12,17 @@ <script> var dateToday = new Date(); + var upto = new Date(); + dateToday.setDate(dateToday.getDate() + 3); + upto.setFullYear(dateToday.getFullYear() + 1); + $(function() { $( ".datepicker" ).datepicker({ changeMonth: true, changeYear: true, - yearRange: "1994:2084", minDate: dateToday, + maxDate: upto // You can put more options here. }); }); diff --git a/workshop_app/views.py b/workshop_app/views.py index a5a7321..59500d6 100644 --- a/workshop_app/views.py +++ b/workshop_app/views.py @@ -181,10 +181,11 @@ def book(request): workshop_occurence_list = [] today = datetime.now() + dt.timedelta(days=3) + upto = datetime.now() + dt.timedelta(weeks=52) for workshops in workshop_details: dates = workshops.recurrences.between( today, - datetime(2018, 12, 31, 0, 0, 0), #Needs to be changed yearly + upto, inc=True ) @@ -281,11 +282,12 @@ def book_workshop(request): workshop_instructor=client_data[1], workshop_title_id=client_data[2] ) - + today = datetime.now() + dt.timedelta(days=3) + upto = datetime.now() + dt.timedelta(weeks=52) for workshop in workshops_list: workshop_recurrence_list = workshop.recurrences.between( - datetime(2017, 3, 12, 0, 0, 0), - datetime(2018, 12, 31, 0, 0, 0), #Needs to be changed yearly + today, + upto, inc=True ) @@ -362,10 +364,11 @@ def manage(request): workshop_occurence_list = [] today = datetime.now() + dt.timedelta(days=3) + upto = datetime.now() + dt.timedelta(weeks=52) for workshop in workshop_details: workshop_occurence = workshop.recurrences.between( today, - datetime(2018, 12, 31, 0, 0, 0), #Needs to be changed yearly + upto, inc=True ) for i in range(len(workshop_occurence)): @@ -478,10 +481,12 @@ def my_workshops(request): workshop_title_id=client_data[2] ) + today = datetime.now() + dt.timedelta(days=3) + upto = datetime.now() + dt.timedelta(weeks=52) for workshop in workshops_list: workshop_recurrence_list = workshop.recurrences.between( - datetime(2017, 3, 12, 0, 0, 0), - datetime(2018, 12, 31, 0, 0, 0), #Needs to be changed yearly + today, + upto, inc=True ) |