Skip to content

Commit

Permalink
calendar_solved
Browse files Browse the repository at this point in the history
  • Loading branch information
debaraja-394 committed Sep 5, 2024
1 parent e827184 commit e09d9e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Binary file modified Government of NCT of Delhi/__pycache__/log_out.cpython-311.pyc
Binary file not shown.
9 changes: 7 additions & 2 deletions Government of NCT of Delhi/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ def user_register():
def all_doc():
return render_template('doctor.html')

def add_days(date, days):
return (date + timedelta(days=days)).strftime('%Y-%m-%d')

@app.route('/appointment', methods=['POST', 'GET'])
@login_required('user')
Expand Down Expand Up @@ -269,11 +271,14 @@ def appointment():
hospitals = hospital_data_collection.find()
hospital_names = [hospital['hospital_name'] for hospital in hospitals]
today = datetime.today().strftime('%Y-%m-%d')
# future_date=add_days(today,15)
max_date = (datetime.today() + timedelta(days=15)).strftime('%Y-%m-%d')
print(max_date)
# max_date = add_days(datetime.today(), 15)

print(f' max date: {max_date}')

return render_template('appointment.html', hospitals=hospital_names,today=today,mx_date=max_date)

return render_template('appointment.html', hospitals=hospital_names,today=today,max_date=max_date)

# This is the queueing system for the appiontments:

Expand Down
7 changes: 3 additions & 4 deletions Government of NCT of Delhi/templates/appointment.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ <h2>Book Appointment</h2>
<!-- Appointment Date Input (limited to 15 days) -->
<div class="mb-3">
<label for="dateInput" class="form-label">Appointment Date</label>
<input type="date" id="dateInput" name="dat" min="{{ today }}" max="{{ today | add_days(15) }}" <!--
Show only next 15 days -->
class="form-control"
/>
<input type="date" id="dateInput" name="dat" min="{{ today }}" max="{{ max_date }}" class="form-control">


</div>

<!-- Time Slot Selection -->
Expand Down

0 comments on commit e09d9e4

Please sign in to comment.