Skip to content

Commit 0bff3ea

Browse files
author
Jegors Cemisovs
committed
Enhance formatting in temporal-adjusters documentation
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.
1 parent 0c94854 commit 0bff3ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

concepts/temporal-adjusters/about.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ LocalDate lastDayOfYear = date.with(TemporalAdjusters.lastDayOfYear());
8585

8686
Adjusters like `next()`, `previous()`, `nextOrSame()`, and `previousOrSame()` find the next or previous occurrence of a given day of the week, relative to the current date.
8787

88-
* `next()`/`previous()`: Excludes the current date if it matches.
89-
* `nextOrSame()`/`previousOrSame()`: Includes the current date if it matches.
88+
- `next()`/`previous()`: Excludes the current date if it matches.
89+
- `nextOrSame()`/`previousOrSame()`: Includes the current date if it matches.
9090

9191
```java
9292
LocalDate thursday = LocalDate.of(2024, Month.AUGUST, 15); // A Thursday
@@ -107,6 +107,7 @@ LocalDate nextOrSameThursday = thursday.with(TemporalAdjusters.nextOrSame(DayOfW
107107
LocalDate previousMonday = thursday.with(TemporalAdjusters.previous(DayOfWeek.MONDAY));
108108
// => 2024-08-12
109109
```
110+
110111
The `nextOrSame()` adjuster is particularly useful for finding dates in ranges like the "teenth" days (13th-19th) of a month, as seen in the Meetup exercise. Applying `nextOrSame(targetDayOfWeek)` to the 13th day of the month will find the correct "teenth" date.
111112

112113
## Custom Adjusters
@@ -131,6 +132,7 @@ LocalDate sunday = LocalDate.of(2024, Month.AUGUST, 18);
131132
LocalDate nextWorkdayFromSunday = sunday.with(nextWorkday);
132133
// => 2024-08-19 (Monday)
133134
```
135+
134136
While custom adjusters are powerful, the predefined adjusters in the `TemporalAdjusters` class cover a wide range of common use cases.
135137

136138
[temporaladjuster-docs]: https://docs.oracle.com/javase/8/docs/api/java/time/temporal/TemporalAdjuster.html

0 commit comments

Comments
 (0)