@aaronsb/jira-cloud-mcp 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,12 +19,18 @@
|
|
|
19
19
|
function formatDate(dateStr) {
|
|
20
20
|
if (!dateStr)
|
|
21
21
|
return 'Not set';
|
|
22
|
+
// Date-only strings (YYYY-MM-DD) are parsed as UTC midnight by Date constructor,
|
|
23
|
+
// then toLocaleDateString shifts them by local TZ offset — causing off-by-one.
|
|
24
|
+
// Parse date-only values directly to avoid timezone shifting.
|
|
25
|
+
const dateOnly = dateStr.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
26
|
+
if (dateOnly) {
|
|
27
|
+
const [, y, m, d] = dateOnly;
|
|
28
|
+
const date = new Date(Number(y), Number(m) - 1, Number(d));
|
|
29
|
+
return date.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
|
|
30
|
+
}
|
|
31
|
+
// Full datetime strings include timezone info, so they render correctly.
|
|
22
32
|
const date = new Date(dateStr);
|
|
23
|
-
return date.toLocaleDateString('en-US', {
|
|
24
|
-
year: 'numeric',
|
|
25
|
-
month: 'short',
|
|
26
|
-
day: 'numeric'
|
|
27
|
-
});
|
|
33
|
+
return date.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
|
|
28
34
|
}
|
|
29
35
|
/**
|
|
30
36
|
* Format status with visual indicator
|
package/package.json
CHANGED