Skip to content

Commit

Permalink
Fix dates on weekly goal pages (#10)
Browse files Browse the repository at this point in the history
Fixes dates on weekly goal pages, both work and personal, as described
in #9.

Signed-off-by: Georgia Stuart <[email protected]>
  • Loading branch information
georgiastuart authored Nov 23, 2022
1 parent aff8cf3 commit 04f32c7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
45 changes: 41 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,52 @@ iPad app goodnotes 5.
- Monthly/Weekly work goals (hyperlinked with briefcase symbol in bottom right corner of monthly/weekly pages).
- Lots of hyperlinking. If it seems like it should direct to another page, it probably does.

## Prerequisites
### Screen shots

#### Annual view

![Annual view](https://user-images.githubusercontent.com/8276147/203629183-412e0cf9-9ba0-4311-9542-54396dd96521.png)

#### Monthly view

![Monthly view](https://user-images.githubusercontent.com/8276147/203629487-03726b4c-6ef8-418c-bc34-cf41a60100f0.png)

#### Weekly view


![Weekly view](https://user-images.githubusercontent.com/8276147/203629643-d0aa6bb7-b904-4685-bf6a-ae9adc9a6a5b.png)

#### Daily view

![Daily view](https://user-images.githubusercontent.com/8276147/203629772-3317b5e0-ee10-425d-b1a4-c175b2050454.png)

#### Monthly personal goals

![Monthly personal goals](https://user-images.githubusercontent.com/8276147/203632411-63bc909a-2687-4a4e-825c-27084cdf25fd.png)

#### Weekly personal goals

![Weekly personal goals](https://user-images.githubusercontent.com/8276147/203632731-09e8f814-845d-42ab-82c5-07b39fbb858c.png)

#### Monthly work goals

![Monthly work goals](https://user-images.githubusercontent.com/8276147/203632843-0e60341f-3373-4653-9fc5-46cbc9f1e098.png)

#### Weekly work goals

![Weekly work goals](https://user-images.githubusercontent.com/8276147/203632936-8860454b-5de8-4c1d-9826-5b426bd2bee1.png)

## Using the generator locally

### Prerequisites

- Python3 >= 3.9
- Jinja2
- python-dateutil
- playwright (Python)
- Node / NPM

## Install
### Install

Run

Expand All @@ -34,7 +71,7 @@ npm install

to install the tailwind dependency.

## Building the planner
### Building the planner

```bash
npm run build -- <start date (YYYY-MM-DD format)> <end date (YYYY-MM-DD format)> <optional arguments>
Expand All @@ -44,7 +81,7 @@ To create the PDF from the HTML output, I recommend opening `index.html` in
Chrome and using the "Save as PDF" feature in the print menu. If using this
technique, set margins to none and enable background images.

### Optional Arguments
#### Optional Arguments

```
usage: Python Planner Generator [-h] [--start-time START_TIME] [--end-time END_TIME] [--file-suffix FILE_SUFFIX] [--work-goals | --no-work-goals]
Expand Down
6 changes: 4 additions & 2 deletions src/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ def build_monthly_goal_page(first, j2_template: j2.Template):
weekly_template = j2_env.get_template('weekly_goals.html.j2')
frame_template = j2_env.get_template('frame.html.j2')
weekly_templates = {}
cur_week = start + relativedelta(weeks=+0)
preceding_monday = start - timedelta(days=start.weekday())
cur_week = preceding_monday + relativedelta(weeks=+0)


while cur_week < end:
Expand Down Expand Up @@ -251,7 +252,8 @@ def build_weekly_work_goal_page(first, j2_template: j2.Template):
weekly_template = j2_env.get_template('weekly_work_goals.html.j2')
frame_template = j2_env.get_template('frame.html.j2')
weekly_templates = {}
cur_week = start + relativedelta(weeks=+0)
preceding_monday = start - timedelta(days=start.weekday())
cur_week = preceding_monday + relativedelta(weeks=+0)


while cur_week < end:
Expand Down

0 comments on commit 04f32c7

Please sign in to comment.