Changeset 6993c72 in OpenWorkouts-current for ow/utilities.py
- Timestamp:
- Feb 4, 2019, 1:10:40 PM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- d52ba50
- Parents:
- bf01534 (diff), 3357e47 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/utilities.py
rbf01534 r6993c72 2 2 import os 3 3 import logging 4 import calendar 4 5 import subprocess 5 6 from datetime import datetime, timedelta … … 234 235 week_days = [first_day + timedelta(days=i) for i in range(7)] 235 236 return week_days 237 238 239 def get_month_week_number(day): 240 """ 241 Given a datetime object (day), return the number of week the day is 242 in the current month (week 1, 2, 3, etc) 243 """ 244 weeks = calendar.monthcalendar(day.year, day.month) 245 for week in weeks: 246 if day.day in week: 247 return weeks.index(week) 248 return None
Note: See TracChangeset
for help on using the changeset viewer.