Skip to content

docs: Introduce new concept for TemporalAdjusters - #2944

Merged
kahgoh merged 10 commits into
exercism:mainfrom
rabestro:issue/2935-TemporalAdjusters
Nov 2, 2026
Merged

kahgoh merged 10 commits into
exercism:mainfrom
rabestro:issue/2935-TemporalAdjusters

Conversation

@rabestro

@rabestro rabestro commented May 4, 2025

Copy link
Copy Markdown
Member

pull request

Description

This PR introduces a new concept, "TemporalAdjusters", to the Java track's syllabus.

Motivation:

It has been observed (e.g., during mentoring for the Meetup exercise) that many students are unfamiliar with the java.time.temporal.TemporalAdjuster interface and the associated TemporalAdjusters utility class. This often leads to complex manual date calculations instead of leveraging these powerful and idiomatic standard library features.

Solution:

This PR adds a dedicated concept to explain TemporalAdjusters, covering:

  • What they are and why they are useful.
  • How to use them via the .with() method.
  • Common predefined adjusters provided by the TemporalAdjusters class (e.g., dayOfWeekInMonth, lastInMonth, nextOrSame).
  • The importance of immutability in java.time.

The following files have been created for this concept:

  • concepts/temporal-adjusters/about.md
  • concepts/temporal-adjusters/introduction.md
  • concepts/temporal-adjusters/links.json

UUID: cc7a06d1-ddb3-4722-88a5-f762254d664e

The concept has also been added to the track's main configuration file using the UUID above.

Goal:

By introducing this concept, we aim to guide students towards using TemporalAdjusters earlier, enabling them to write more idiomatic and robust solutions for date-related exercises.

Closes #2937


Reviewer Resources:

Track Policies

@kahgoh

kahgoh commented May 5, 2025 •

Copy link
Copy Markdown
Member

Ah, I noticed you've moved the meetup exercise to a concept exercise. We shouldn't be doing that because it is a practice exercise, with a problem spec in the problem-specifications repo (so the tests are shared across the tracks).

Instead, we should come up with another concept exercise to introduce temporal adjusters. For the concept exercise, we'll need to choose a background story. For example, we're using Booking Up For Beauty for Local Date/Time. For temporal adjusters, C# also uses Beauty Salon Goes Global - we could probably do the same. Alternatively, we could also look through the list to see what other stories are used.

We should also add temporal-adjusters as a prerequisite to the meetup exercise so that the meetup exercise is enabled only after students learn the concept.

@rabestro

rabestro commented May 7, 2025

Copy link
Copy Markdown
Member Author

Ah, I noticed you've moved the meetup exercise to a concept exercise. We shouldn't be doing that because it is a practice exercise, with a problem spec in the problem-specifications repo (so the tests are shared across the tracks).

Instead, we should come up with another concept exercise to introduce temporal adjusters. For the concept exercise, we'll need to choose a background story. For example, we're using Booking Up For Beauty for Local Date/Time. For temporal adjusters, C# also uses Beauty Salon Goes Global - we could probably do the same. Alternatively, we could also look through the list to see what other stories are used.

We should also add temporal-adjusters as a prerequisite to the meetup exercise so that the meetup exercise is enabled only after students learn the concept.

Thank you for your suggestion. To be honest, I was also thinking about a special exercise. It take some time :)

@IsaacG

IsaacG commented Oct 29, 2026

Copy link
Copy Markdown
Member

@rabestro Is this something you're still working on?

@rabestro

rabestro commented Oct 30, 2026 •

Copy link
Copy Markdown
Member Author

@rabestro Is this something you're still working on?

Thanks for pinging me.

Jegors Cemisovs added 6 commits October 30, 2026 11:07
Introduces the `Temporal Adjusters` concept, including an overview, examples, and links for Java's `TemporalAdjuster` and `TemporalAdjusters` utilities. Updates `config.json` to include the concept and a new exercise, "Meetup," with relevant prerequisites.
Simplify the introduction and examples for `TemporalAdjusters` to improve clarity and focus on practical use cases. Removed redundant examples and reorganized sections to prioritize key adjusters like ordinal days and "teenth" date calculations. Enhanced consistency and readability across code snippets and explanations.
Adjusted the `blurb` text for clarity and reformatted the `authors` field for improved readability. These changes maintain consistency with JSON coding standards and enhance the file's maintainability.
Replaced asterisks with dashes for consistency in list formatting and added blank lines for better readability. These changes improve the overall structure and clarity of the documentation.
Standardize heading levels for consistency and readability. Changed `###` to `##` in multiple sections to align with the document's structure. No content modifications were made.
The links to LocalDate and DayOfWeek documentation were unused and have been removed to improve clarity and maintainability. This helps keep the documentation clean and focused.
@rabestro
rabestro force-pushed the issue/2935-TemporalAdjusters branch from e76ec25 to 32c74e7 Compare October 30, 2026 09:08
@rabestro

Copy link
Copy Markdown
Member Author

Rebased on main and dropped the move of meetup to a concept exercise, following @kahgoh's feedback above. The PR now only adds the temporal-adjusters concept: concepts/temporal-adjusters/ plus its entry in config.json. A dedicated concept exercise for it would be a separate PR.

Jegors Cemisovs and others added 2 commits October 30, 2026 11:35
The concept exercise asks students to write a TemporalAdjuster of their
own, so the introduction shown before the exercise needs to cover it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A sequel to booking-up-for-beauty that teaches the temporal-adjusters
concept: standing appointments for regular clients (dayOfWeekInMonth,
lastInMonth, nextOrSame), the month-end bookkeeping day (lastDayOfMonth,
previous) and a reusable custom adjuster for the weekend rule.

Also adds temporal-adjusters as a prerequisite of the meetup practice
exercise, as requested in review.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rabestro

Copy link
Copy Markdown
Member Author

Added a concept exercise for the concept, beauty-salon-regulars: a sequel to Booking Up For Beauty where regular clients have standing appointments ("every second Tuesday", "the last Friday of the month"). Five tasks cover dayOfWeekInMonth, lastInMonth, nextOrSame, lastDayOfMonth with previous, and a small custom TemporalAdjuster for a weekend rule. temporal-adjusters is now also a prerequisite of the meetup practice exercise. The story is new, so it is not in the stories catalog yet; happy to adjust the story or the task set.

@rabestro
rabestro requested a review from kahgoh October 31, 2026 17:24

@kahgoh kahgoh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rabestro! It looks mostly good, just some minor comments below.

Comment thread concepts/temporal-adjusters/about.md Resolved
Comment thread concepts/temporal-adjusters/about.md Resolved
Comment thread concepts/temporal-adjusters/about.md Resolved
Comment thread concepts/temporal-adjusters/links.json Resolved
- Put each sentence on its own line in about.md and introduction.md
- Drop the paragraph and section that hint at the Meetup practice exercise;
  introduce next()/previous()/nextOrSame() on their own instead
- Point Javadoc links in about.md, links.json and the exercise hints to Java 25
- Regenerate the exercise introduction from the updated concept

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rabestro

rabestro commented Nov 1, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review! Addressed in 658421b: each sentence now starts on a new line in about.md and introduction.md, the Meetup paragraph is removed, and the Javadoc links in about.md, links.json and the exercise hints now point to Java 25. I also replaced the "teenth" section in introduction.md with the next/previous content from about.md, since it hinted at the same exercise.

@kahgoh kahgoh added the ready-to-translate The English in this PR is final; queue its translations label Nov 2, 2026
exercism-i18n Bot added a commit to exercism/i18n that referenced this pull request Nov 2, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@exercism-i18n

exercism-i18n Bot commented Nov 2, 2026

Copy link
Copy Markdown

This PR has been translated 🚀

@kahgoh
kahgoh merged commit 4cfe88d into exercism:main Nov 2, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-translate The English in this PR is final; queue its translations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants