Prepare v1.3.7 release#31
Conversation
| return c.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); | ||
| } | ||
|
|
||
| function buildParseFormat(format) { |
There was a problem hiding this comment.
CRITICAL: Date format parsing case-sensitivity bug
The buildParseFormat function converts format to lowercase (format.slice(i).toLowerCase()) and checks for 'yyyy', 'mm', 'dd'. However, the default format is 'YYYY-MM-DD' (uppercase). This will cause date parsing to fail because uppercase 'YYYY' won't match lowercase 'yyyy' check.
| function buildParseFormat(format) { | |
| const slice = format.slice(i); | |
| if (slice.toLowerCase().startsWith('yyyy')) { |
| let i = 0; | ||
| while (i < format.length) { | ||
| const slice = format.slice(i).toLowerCase(); | ||
| if (slice.startsWith('yyyy')) { |
There was a problem hiding this comment.
CRITICAL: Case mismatch continues for month format
Same issue as line 16 - uppercase 'MM' in default format won't match lowercase 'mm' check.
| if (slice.startsWith('yyyy')) { | |
| } else if (slice.toLowerCase().startsWith('mm')) { |
| regex += '(\\d{2})'; | ||
| order.push('m'); | ||
| i += 2; | ||
| } else if (slice.startsWith('dd')) { |
There was a problem hiding this comment.
CRITICAL: Case mismatch for day format
Same issue - uppercase 'DD' won't match lowercase 'dd' check.
| } else if (slice.startsWith('dd')) { | |
| } else if (slice.toLowerCase().startsWith('dd')) { |
| let out = ''; | ||
| let i = 0; | ||
| while (i < format.length) { | ||
| const slice = format.slice(i).toLowerCase(); |
There was a problem hiding this comment.
CRITICAL: Formatting function has same case-sensitivity issue
The formatDate function also converts to lowercase but should preserve case-insensitive matching while outputting correct literal characters.
| const slice = format.slice(i).toLowerCase(); | |
| const slice = format.slice(i); | |
| if (slice.toLowerCase().startsWith('yyyy')) { |
| if (slice.startsWith('yyyy')) { | ||
| out += yyyy; | ||
| i += 4; | ||
| } else if (slice.startsWith('mm')) { |
There was a problem hiding this comment.
CRITICAL: Month formatting case mismatch
| } else if (slice.startsWith('mm')) { | |
| } else if (slice.toLowerCase().startsWith('mm')) { |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Overview
Previous Issue (RESOLVED)✅ Fixed: Date format parsing case-sensitivity bug in
Files Reviewed in Incremental Update (1 file)
Note: Build artifacts (dist/*) updated with timestamps but not reviewed as they are generated files. All Files Previously Reviewed
Reviewed by deepseek-v3.2-20251201 · 363,343 tokens |
|
Thanks for the review. I checked the flagged date format logic in js/components/datepicker.js and the reported case-sensitivity issue is not reproducible: both parse and format paths already normalize tokens via toLowerCase() before matching yyyy/mm/dd. For clarity (and to reduce future false positives), I still pushed a no-behavior-change follow-up refactor that makes the case-insensitive matching explicit at each token check:
Validation after the refactor:
Given this, I consider the original complaint a false positive, and the branch now includes an explicit form of the same logic. |
Summary
Validation