mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08:00
fix: use local-time Date constructor in session-manager to prevent timezone day shift
new Date('YYYY-MM-DD') creates UTC midnight, which in negative UTC offset
timezones (e.g., Hawaii) causes getDate() to return the previous day.
Replaced with new Date(year, month - 1, day) for correct local-time behavior.
Added 15 tests: session-manager datetime verification and edge cases (7),
package-manager getCommandPattern special characters (4), and
validators model/skill-reference validation (4). Tests: 651 → 666.
This commit is contained in:
@@ -47,8 +47,10 @@ function parseSessionFilename(filename) {
|
||||
filename,
|
||||
shortId,
|
||||
date: dateStr,
|
||||
// Convert date string to Date object
|
||||
datetime: new Date(dateStr)
|
||||
// Use local-time constructor (consistent with validation on line 40)
|
||||
// new Date(dateStr) interprets YYYY-MM-DD as UTC midnight which shows
|
||||
// as the previous day in negative UTC offset timezones
|
||||
datetime: new Date(year, month - 1, day)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user