# Q-Week Count Widget

This is a lightweight, configurable widget designed for embedding in Notion dashboards. It displays how many weeks have elapsed since a configurable start date and visually represents progress toward any time period goal.

## 🔧 Supported URL Parameters

These optional query parameters allow you to customize the appearance and behavior of the widget:

| Parameter       | Description                                                  | Example Value        | Default           |
|----------------|--------------------------------------------------------------|---------------------|-------------------|
| `bg_colour`     | Background color (hex, no `#`)                                | `f3eeee`            | `f3eeee`          |
| `progress_fg`   | Foreground (filled) color of the progress indicator          | `605f5b`            | `000000`          |
| `progress_bg`   | Background (empty) color of the progress indicator           | `8d8b88`            | `8d8d8d`          |
| `progress_type` | Type of progress display: `bar` or `circle` (donut style)    | `circle`            | `circle`          |
| `theme`         | Force theme: `light` or `dark`                               | `dark`              | `light`           |
| `start_date`    | Start date of tracking period                                | `2025-01-01`        | `2025-04-01`      |
| `end_date`      | End date of tracking period                                  | `2025-03-31`        | `2025-06-30`      |
| `label`         | Custom label text (URL-encoded)                              | `Q1%20Progress`     | `Weeks into Q2 2025` |

## 📅 Date Format Support

The widget supports multiple date formats for `start_date` and `end_date`:
- **ISO format:** `YYYY-MM-DD` (e.g., `2025-01-01`)
- **US format:** `MM/DD/YYYY` (e.g., `01/01/2025`)
- **Short format:** `M/D/YYYY` (e.g., `1/1/2025`)

## 🎨 Notion Color Schemes

Pre-tested color combinations that match Notion's built-in themes:

### 🤎 Notion Brown/Beige
```
bg_colour=f3eeee&progress_fg=000000&progress_bg=8d8b88
```

### 🔵 Notion Blue  
```
bg_colour=E9F3F7&progress_fg=4F96E4&progress_bg=8CC3F8
```

### 🩷 Notion Pink
```
bg_colour=FAF1F6&progress_fg=CF6CA3&progress_bg=DC94BB
```

## 🧠 Behavior
- If `theme` is not provided, the widget attempts to infer the theme based on the background color.
- If `progress_type` is not specified, the widget defaults to a circular donut display.
- When `progress_type=circle`, the widget renders a donut-style circular ring, matching Notion's visual language.
- The value shown is automatically updated to reflect the number of weeks since the specified start date.
- Progress percentage adapts to any date range - not limited to quarters.

## 💡 Example Usage

### Basic Q3 2025 Tracking
```html
<iframe
  src="https://widgets.wilarndt.com/q-week-count/?start_date=2025-07-01&end_date=2025-09-30&label=Weeks%20into%20Q3%202025&progress_type=bar"
  style="width: 100%; height: 200px; border: none;"
></iframe>
```

### Custom Project Timeline with Notion Blue Theme
```html
<iframe
  src="https://widgets.wilarndt.com/q-week-count/?start_date=2025-01-15&end_date=2025-04-15&label=Project%20Alpha&progress_type=circle&bg_colour=E9F3F7&progress_fg=4F96E4&progress_bg=8CC3F8"
  style="width: 100%; height: 200px; border: none;"
></iframe>
```

### Sprint Tracking with Pink Theme
```html
<iframe
  src="https://widgets.wilarndt.com/q-week-count/?start_date=07/01/2025&end_date=08/15/2025&label=Sprint%2012&progress_type=bar&bg_colour=FAF1F6&progress_fg=CF6CA3&progress_bg=DC94BB"
  style="width: 100%; height: 200px; border: none;"
></iframe>
```

## ⚡ Features

- **Configurable time periods:** Track any date range, not just quarters
- **Multiple display modes:** Circle (donut) or horizontal bar progress
- **Weekly average calculator:** Built-in tool to calculate average hours per week
- **Responsive design:** Matches Notion's visual language and typography
- **Theme support:** Light/dark themes with automatic detection
- **Custom styling:** Full color customization via URL parameters
- **Flexible date input:** Multiple date format support for ease of use

## 📁 GitHub
[github.com/warndt/warndt-notion-widgets-q-week-count](https://github.com/warndt/warndt-notion-widgets-q-week-count)

---
Made to integrate seamlessly into Notion dashboards ✨
