-
Notifications
You must be signed in to change notification settings - Fork 0
/
date_play.py
46 lines (36 loc) · 966 Bytes
/
date_play.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 16 23:16:18 2016
@author: pfduc
"""
#from datetime import date
#from dateutil.relativedelta import relativedelta
#
#
#mydates=[]
#
#for i in range(60):
#
# mydates.append(date.today() + absolutedelta(day=+i))
#
# print(mydates[i]).isoformat()
#
import numpy as np
import datetime
"""
this generates the dates from today and up to ndays in the future and their key is the weekday
0 for monday and so on
"""
import calendar
def get_month_dates(cur_month = datetime.date.today().month):
myc = calendar.Calendar()
dg = np.array([i for i in myc.itermonthdates(2016,cur_month)])
#myc=calendar.TextCalendar()
#
#print myc.formatmonth(2016,6)
nweeks = 4
#store the dates in a scheduler
ws = np.reshape(dg,(nweeks+1,7))
return ws
#each new booking should have the time, so when we select the time wanted we can display all rooms which DO NOT clash
#print get_month_dates()