Bug 41387 - Add option for 2 digit month to serial patterns
Summary: Add option for 2 digit month to serial patterns
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords: Manual
Depends on: 35646
Blocks:
  Show dependency treegraph
 
Reported: 2025-12-05 14:22 UTC by Nick Clemens (kidclamp)
Modified: 2025-12-07 03:49 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This adds some new placeholders to be used within the numbering pattern of a subscription: {Day2} and {Month2}. They will be automatically replaced with the corresponding 2 digit value derived from the publication date of the issue when its received.
Version(s) released in:
Circulation function:


Attachments
Bug 41387: Add option for 2 digit month to serials (3.21 KB, patch)
2025-12-05 14:28 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 41387: Add 2 digit day option as well (4.69 KB, patch)
2025-12-05 14:28 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 41387: Add option for 2 digit month to serials (3.26 KB, patch)
2025-12-07 03:49 UTC, David Nind
Details | Diff | Splinter Review
Bug 41387: Add 2 digit day option as well (4.73 KB, patch)
2025-12-07 03:49 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-12-05 14:22:30 UTC
The manual says:

Numbering formula: this is what is used to create the number for each issue. You can use placeholders for up to three variables {X}, {Y}, and {Z} (which can be defined below), as well as predetermined variables:

    {Day} will be replaced by the date (two digits)

    {Month} will be replaced by the month number (two digits)

    {Year} will be replaced by the year (four digits)

    {DayName} will be replaced by the name of the day of the week

https://koha-community.org/manual/23.11/en/html/serials.html#adding-serial-numbering-pattern-label

But we actually replace the month with a single digit, we should have an option for 2
Comment 1 Nick Clemens (kidclamp) 2025-12-05 14:28:41 UTC
Created attachment 190214 [details] [review]
Bug 41387: Add option for 2 digit month to serials

To test:
0 - Apply patch
1 - Setup a new numbering pattern
    Serials->Manage numbering patterns + New numbering pattern
2 - In the numbering formula enter: {X} {Y} {Z} {Year} {Month} {Month2} {Day} {MonthName} {DayName}
3 - Populate X/Y/Z in the table as you wish, these should be unaffected by patch
4 - Set a Frequency /  First issue plublication date / Subscription length
5 - Click 'Test pattern'
6 - Confirm the dates in the Number match the publication date values
7 - Try with different frequencies to confirm they match
8 - Save the pattern
9 - Create a new subscription and use the new pattern
10 - Confirm it works as expected
Comment 2 Nick Clemens (kidclamp) 2025-12-05 14:28:44 UTC
Created attachment 190215 [details] [review]
Bug 41387: Add 2 digit day option as well

While adding 2 digit months, let's add 2 digit days as well.
These are necessary to ensure correct sorting, that is the reason for this request

To test:
0 - Apply patch
1 - Setup a new numbering pattern
    Serials->Manage numbering patterns + New numbering pattern
2 - In the numbering formula enter: {X} {Y} {Z} {Year} {Month} {Month2} {Day} {Day2} {MonthName} {DayName}
3 - Populate X/Y/Z in the table as you wish, these should be unaffected by patch
4 - Set a Frequency /  First issue plublication date / Subscription length
5 - Click 'Test pattern'
6 - Confirm the dates in the Number match the publication date values
7 - Try with different frequencies to confirm they match
8 - Save the pattern
9 - Create a new subscription and use the new pattern
10 - Confirm it works as expected
Comment 3 David Nind 2025-12-07 03:49:40 UTC
Created attachment 190274 [details] [review]
Bug 41387: Add option for 2 digit month to serials

To test:
0 - Apply patch
1 - Setup a new numbering pattern
    Serials->Manage numbering patterns + New numbering pattern
2 - In the numbering formula enter: {X} {Y} {Z} {Year} {Month} {Month2} {Day} {MonthName} {DayName}
3 - Populate X/Y/Z in the table as you wish, these should be unaffected by patch
4 - Set a Frequency /  First issue plublication date / Subscription length
5 - Click 'Test pattern'
6 - Confirm the dates in the Number match the publication date values
7 - Try with different frequencies to confirm they match
8 - Save the pattern
9 - Create a new subscription and use the new pattern
10 - Confirm it works as expected

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2025-12-07 03:49:43 UTC
Created attachment 190275 [details] [review]
Bug 41387: Add 2 digit day option as well

While adding 2 digit months, let's add 2 digit days as well.
These are necessary to ensure correct sorting, that is the reason for this request

To test:
0 - Apply patch
1 - Setup a new numbering pattern
    Serials->Manage numbering patterns + New numbering pattern
2 - In the numbering formula enter: {X} {Y} {Z} {Year} {Month} {Month2} {Day} {Day2} {MonthName} {DayName}
3 - Populate X/Y/Z in the table as you wish, these should be unaffected by patch
4 - Set a Frequency /  First issue plublication date / Subscription length
5 - Click 'Test pattern'
6 - Confirm the dates in the Number match the publication date values
7 - Try with different frequencies to confirm they match
8 - Save the pattern
9 - Create a new subscription and use the new pattern
10 - Confirm it works as expected

Signed-off-by: David Nind <david@davidnind.com>