You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import moment from "moment-timezone";
import "@rangerrick/moment-javaformat";
...
let date = moment("2000");
return date.formatJavaSDF("yyyyy"); // should be 02000
The following error occured with the code snipped:
Error: 'yyyyy' cannot be converted to a moment format token; unknown token
at t.value (src/test/frontend/tests.bundle.js:9437:10016)
at x.e.fn.formatJavaSDF (src/test/frontend/tests.bundle.js:9437:3745)
at t.a (src/test/frontend/tests.bundle.js:9573:309)
at src/test/frontend/tests.bundle.js:10851:3660
at Array.map (<anonymous>)
at Context.<anonymous> (src/test/frontend/tests.bundle.js:10851:3625)
After fiddle around a bit, some further Formatter will not work: F and W.
The text was updated successfully, but these errors were encountered:
F and W in SimpleDateFormat are known broken and very difficult to implement in a sane way. I should document that somewhere other than the unit tests. :)
As for yyyyy not working, I only did support for up to 4 entries as that's what's shown in the official javadoc for SDF and DTF. I've gone ahead and created test data for 1-6 entries, and made everything work now. I'll put out a 1.0.3 release with these fixes as soon as I get the chance.
First of all: your library works great!
Sadly one Edge-Case does not work:
See Java-Examples: https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html.
The following error occured with the code snipped:
After fiddle around a bit, some further Formatter will not work:
F
andW
.The text was updated successfully, but these errors were encountered: