datetimeformatter: DateTimeFormatter cheat sheet module (pattern letters incl. the four hour letters, yyyy vs YYYY week-year bug and WeekFields, en_IN locales and the U+202F AM/PM trap with parseLenient fix, SMART/STRICT/LENIENT parsing, ISO constants, SimpleDateFormat thread safety), 18 contract tests

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b3fvyFpxThdRxcozLx
This commit is contained in:
Claude
2026-11-14 01:24:52 +05:30
parent c8588ae520
commit 5faa57bb2d
22 changed files with 944 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Regenerates every file in output/. 07 (threads) drifts between runs: the counts are indicative.
set -euo pipefail
cd "$(dirname "$0")/.."
mvn -q -B compile
mkdir -p output
run() { java -Dstdout.encoding=UTF-8 -cp target/classes "com.ankurm.datetimeformatter.$1" 2>&1 | grep -v '^Picked up JAVA_TOOL_OPTIONS' > "output/$2.txt"; }
run PatternLettersDemo 01-pattern-letters
run WeekYearBugDemo 02-week-year-bug
run LocaleDemo 03-locales
run ParsingDemo 04-parsing
run IsoFormatsDemo 05-iso-formats
run ErrorsDemo 06-errors
run ThreadSafetyDemo 07-thread-safety
mvn -B test 2>&1 | grep -E 'Tests run|BUILD|ERROR|FAIL' | grep -v 'Picked up' > output/08-tests.txt
echo "regenerated:"; ls output
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Run one demo: scripts/run.sh WeekYearBugDemo
set -euo pipefail
cd "$(dirname "$0")/.."
mvn -q -B compile
java -Dstdout.encoding=UTF-8 -cp target/classes "com.ankurm.datetimeformatter.${1:?demo class name}"