Skip to content

Period starting date can be set to the past #10

@olli-suutari-jkl

Description

@olli-suutari-jkl

When creating a period, it is possible to change the starting date to a past date.
Saving the period also saves it to the database refs.periods.validFrom.

From: libraries-fi/kirkanta-api#4

Changing past schedules is not allowed because users would most likely only screw them up unintentionally. There is no need to create schedules into the past as there is no use-case for that. The only supported case would be for statistics and this is also the reason why users are blocked from modifying the past.

Right now schedule modification apply starting Monday of the running week so that weekly tables could be fixed if there has been an error.

This restriction applies to API v3 as well;
https://github.com/libraries-fi/legacy-kirkanta/blob/master/module/ScheduleGenerator/src/Subscriber/GenerateSchedules.php#L54
https://github.com/libraries-fi/legacy-kirkanta/blob/master/module/ScheduleGenerator/src/Controller/ScheduleController.php#L67

Originally posted by @sjuvonen in libraries-fi/kirkanta-api#4 (comment)

Just accept that for some libraries there will be no schedules into the past, there is no other solution to it. For reference, in Kirjastohakemisto it is not possible to navigate into the past weeks at all.

Originally posted by @sjuvonen in libraries-fi/kirkanta-api#4 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions