You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fesod.apache.org by "BigDataDZ (via GitHub)" <gi...@apache.org> on 2026/10/08 12:16:25 UTC

Re: [I] [Task] Implement more commonly used converter classes [fesod]

BigDataDZ commented on issue #1017:
URL: https://github.com/apache/fesod/issues/1017#issuecomment-6059647387

   I'd like to propose a follow-up batch of four JDK 8 compatible types that are neither on the task list nor proposed yet (verified against `DefaultConverterLoader` and this thread): `java.time.Month`, `java.time.DayOfWeek`, `java.time.Period` and `java.time.Duration`.
   
   Proposed approach - one bidirectional STRING converter per type, following the `*StringConverter` pattern:
   
   1. **`MonthStringConverter`** (`converters/month`): writes `Month#getDisplayName(TextStyle.FULL, locale)` respecting `GlobalConfiguration.locale` (or a `@DateTimeFormat` custom pattern with numeric `uuuu-MM` style values also accepted on read); reads case-insensitively via `Month#valueOf` and 1-12 numerically.
   2. **`DayOfWeekStringConverter`** (`converters/dayofweek`): same shape as above over `DayOfWeek`, with 1-7 numeric read support (ISO-8601 Monday=1).
   3. **`PeriodStringConverter`** (`converters/period`): writes `Period#toString()` (ISO-8601 `P1Y2M3D`); reads via `Period#parse`, `null` stays `null`.
   4. **`DurationStringConverter`** (`converters/duration`): writes `Duration#toString()` (`PT5H30M`); reads via `Duration#parse`, `null` stays `null`.
   
   Each ships with JUnit 5 unit tests (round-trip, locale handling where applicable, invalid input reported as `ExcelDataConvertException` instead of being silently coerced) and registration in `DefaultConverterLoader`. Happy to split them into one PR per type or batch two-and-two, whichever maintainers prefer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org