> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gym.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Task Transform (Calendr only)

> Convert absolute dates to variable-based dates

Transform prompts with absolute dates into variable-based prompts. Variable dates use the session's base Monday as an anchor point, keeping scenarios relevant over time.

## Request Body

<ParamField body="prompt" type="string" required>
  Text containing absolute dates to transform (e.g., "Schedule a meeting on 2025-01-15")
</ParamField>

<ParamField body="sessionId" type="string" required>
  Session identifier (used to determine the base Monday)
</ParamField>

## Response

<ResponseField name="originalPrompt" type="string">
  The original prompt with absolute dates
</ResponseField>

<ResponseField name="transformedPrompt" type="string">
  The transformed prompt with variable dates
</ResponseField>

## Supported Date Formats

The endpoint automatically detects and converts:

* **ISO dates**: `YYYY-MM-DD` (e.g., 2025-01-15)
* **Month names**: Full month names with year (e.g., January 2025)

## Variable Date Formats

| Format    | Example   | Meaning                        |
| --------- | --------- | ------------------------------ |
| \{+N Day} | \{+0 Mon} | Monday of the base week        |
| \{+N Day} | \{+1 Wed} | Wednesday, one week after base |
| \{-N Day} | \{-1 Thu} | Thursday, one week before base |

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST http://localhost:3000/task \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "Schedule a meeting on 2025-01-15",
      "sessionId": "demo-session"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "originalPrompt": "Schedule a meeting on 2025-01-15",
    "transformedPrompt": "Schedule a meeting on {+1 Wed}"
  }
  ```
</ResponseExample>
