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:
Affaan Mustafa
2026-02-13 03:29:04 -08:00
parent 992688a674
commit b1eb99d961
4 changed files with 155 additions and 2 deletions

View File

@@ -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)
};
}