WWeekOrison
Workflows

Coding workflows · ISO week-date conversion

03
Built around your work

A concrete starting point

Convert an ISO week-year, week and weekday to a date with year limits 1–9999. Check year crossings and invalid week 53, rejecting Boolean components and dates outside the calendar range.

01

Open the context

Choose the project folder and name the files or behavior involved.

02

Define the change

Describe the input, expected output and boundaries that must stay intact.

03

Inspect the work

Review the proposed edits and any commands before relying on their result.

04

Check the outcome

Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.

ISO week-date conversion

A concrete starting point
from datetime import date
def iso_week_date(year, week, weekday):
    values = (year, week, weekday)
    if any(type(x) is not int for x in values):
        raise ValueError("integer components")
    if not 1 <= year <= 9999:
        raise ValueError("year range")
    if not 1 <= week <= 53 or not 1 <= weekday <= 7:
        raise ValueError("week or weekday range")
    return date.fromisocalendar(year, week, weekday)

The example is a starting point for a real project, not a claim that generated code is already tested. Adjust paths, dependencies and expected behavior to match your application.

AI coding workspace

Your next change starts here.

Get the Windows app ↗