diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2018-01-08 10:54:10 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2018-01-08 10:54:10 -0500 |
| commit | a7966a6ab6ed824613f1e22b568a1eba56e8369f (patch) | |
| tree | 3d23bbb2230ee5638f69a065baa78dc07375634c /app/dispatch/misc.py | |
| parent | cb16790ea8be3dde400aa092808bca3e71c79235 (diff) | |
| download | dispatch-tracker-a7966a6ab6ed824613f1e22b568a1eba56e8369f.tar.gz dispatch-tracker-a7966a6ab6ed824613f1e22b568a1eba56e8369f.tar.xz | |
Initial ability to generate invoices from the fake data tool
Diffstat (limited to 'app/dispatch/misc.py')
| -rw-r--r-- | app/dispatch/misc.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/dispatch/misc.py b/app/dispatch/misc.py index 14bb5e7..e0976bf 100644 --- a/app/dispatch/misc.py +++ b/app/dispatch/misc.py @@ -3,11 +3,17 @@ from datetime import datetime, timedelta from dateutil import rrule import uuid +# Text formatted date. *sigh* def get_week_dates(date=None): - week_dates = {} if date == None: date = formats.date_format(datetime.now(), "SHORT_DATE_FORMAT") dt = datetime.strptime(date, '%m/%d/%Y') + + return get_week_dates_datetime(dt=dt) + +def get_week_dates_datetime(dt=None): + week_dates = {} + weekday = dt.weekday() if weekday == 6: week_dates['start_date'] = dt |
