Closed m-jung closed 11 months ago
We cannot do anything about issues in upstream dependencies, please open an issue at the js-joda GitHub repo: https://github.com/js-joda/js-joda/issues.
Once the bug is fixed upstream, please let me know so we can upgrade js-joda.
Sorry, my bad. I've meant to open this issue for js-joda in the first place. For documentation, the same issue at js-joda: https://github.com/js-joda/js-joda/issues/689
Calling
DateTimeFormatterBuild.appendValue()
with 3 arguments results in anNullPointerException
undefined must not be nullExpected Behavior
The Documentation / TypeScript Definitions should correspond with the actual behavior.
Current Behavior
js-joda.d.ts defines
appendValue()
with one required and three optional arguments:appendValue(field: TemporalField, width?: number, maxWidth?: number, signStyle?: SignStyle): DateTimeFormatterBuilder;
But using three arguments results in anNullPointerException
as the call delegates to_appendValues4()
, which requiresSignStyle
as fourth argument.Possible Solution
The TypeScript Definition should either state that one, two or four arguments are reuqired.
or
DateTimeFormatterBuilder
should implement_appendValues3()
taking three arguments.Steps to Reproduce (for Bugs)
new DateTimeFormatterBuilder().appendValue(ChronoField.YEAR, 3, 4)
Context
The intention was to build an formatter which allows to parse either three or four digit years.
Your Environment
The affected Version is @js-joda/core@5.5.3