blob: 688545a77da2e312c8ddf9ed830550e6f7df58e7 [file] [log] [blame]
pranav nachnekar7b9e3092019-08-28 16:57:37 +05301import frappe
2import datetime
3
4
5def get_context(context):
6 context.date = frappe.form_dict['date']
7 settings = frappe.get_doc('Appointment Booking Settings')
8 holiday_list = frappe.get_doc('Holiday List', settings.holiday_list)
9 if(is_holiday(context.date,holiday_list)):
10 context.is_holiday = True
11 return context
12 get_time_slots(context.date,settings)
13 # time_slots = get_time_slots(date)
14 return context
15
16def is_holiday(date,holiday_list):
17 for holiday in holiday_list.holidays:
18 if holiday.holiday_date.isoformat() == date:
19 print('matched')
20 return True
21 return False
22
23
24
25def _deltatime_to_time(deltatime):
26 return (datetime.datetime.min + deltatime).time()
27
28weekdays = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]