DDayThistle
AI coding workspace

Holiday-aware working-day shifts

DayThistle supports Windows project conversations about moving dates across working days. Review a model’s proposed weekend, holiday and calendar-boundary tests before accepting its date logic.

● ● ●DayThistle●
A concrete starting point · Holiday-aware working-day shifts ×
from datetime import date, timedelta

def working_day_shift(start, days, holidays):
    if type(start) is not date or type(days) is not int or not -366 <= days <= 366:
        raise ValueError("days.input")
    if type(holidays) is not set or len(holidays) > 1000 or any(type(d) is not date for d in holidays):
        raise ValueError("days.holidays")
    remaining, step = abs(days), 1 if days >= 0 else -1
    for _ in range(7*(remaining+len(holidays))+7):
        if remaining == 0:
            return start
        try:
            start += timedelta(days=step)
        except OverflowError as error:
            raise ValueError("days.range") from error
        if start.weekday() < 5 and start not in holidays:
            remaining -= 1
    raise RuntimeError("days.steps")
✳Holiday-aware working-day shifts
✓ ChangesReview before applying ↗
Illustrative workspace
Project
Check zero, reverse shifts and calendar limits, rejecting invalid date types without changing the holiday set.
Review before applying
Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.
Connection
Base URL, credentials and a reachable server.
Workflows

Holiday-aware working-day shifts

Workflows ↗
A concrete starting point
from datetime import date, timedelta

def working_day_shift(start, days, holidays):
    if type(start) is not date or type(days) is not int or not -366 <= days <= 366:
        raise ValueError("days.input")
    if type(holidays) is not set or len(holidays) > 1000 or any(type(d) is not date for d in holidays):
        raise ValueError("days.holidays")
    remaining, step = abs(days), 1 if days >= 0 else -1
    for _ in range(7*(remaining+len(holidays))+7):
        if remaining == 0:
            return start
        try:
            start += timedelta(days=step)
        except OverflowError as error:
            raise ValueError("days.range") from error
        if start.weekday() < 5 and start not in holidays:
            remaining -= 1
    raise RuntimeError("days.steps")
AI coding workspace

Make scheduling rules explicit before editing date code

Scheduling code often mixes business policy with ordinary calendar arithmetic. DayThistle is a Windows AI coding workspace where you can separate those questions while reviewing your project. Start with the date the application produces, the expected date and the rules behind that expectation. Ask the connected model to inspect the relevant code before suggesting a correction.

For example, you could request a review of a deadline helper that skips weekends and a supplied holiday set. Explain whether the start day counts, how negative shifts behave and who provides the holiday data. Ask for a proposal that preserves these decisions in the caller as well as the helper, rather than assuming one universal definition of a working day.

Verify the proposed changes using fixtures drawn from those rules. Include a weekend crossing, a holiday adjacent to a weekend, a zero shift and a backward movement. Run the project’s tests and inspect the boundary behavior for unsupported dates. A correct-looking deadline in one example does not establish that all callers use the same policy.

DayThistle connects to supported OpenAI-compatible or Anthropic endpoints. You can choose an uncensored AI model offered by your service; available tools and context remain server-dependent. Keep the policy written into the task so the model assists implementation without silently deciding how your organization schedules work.

Questions behind a working-day change

Does DayThistle supply a holiday calendar?

The example task uses holiday data supplied by your application. Identify its source and expected coverage in the request. Do not assume that opening the workspace provides current regional holidays or decides which observances affect your deadlines.

Should the starting day count toward the shift?

Specify that rule explicitly and include a fixture where the start falls on a working day. Different policies produce different answers. Ask the assistant to preserve the chosen convention in both forward and backward movement.

How do I separate bad holiday data from a code defect?

Keep the exact holiday set with the failing fixture and inspect its contents before changing the calculation. Compare the result against the written policy. A missing holiday entry and an incorrect skip condition require different corrections.

What if the proposed loop has no clear stopping condition?

Ask how the implementation bounds supported shifts and handles calendar overflow. Review that behavior before accepting it. Run boundary tests alongside ordinary dates so a fix for one deadline does not introduce an unbounded calculation.

Get the Windows app ↗

DayThistle · Updated 2026-10-25