brightspace-mcp-server 3.11.14 → 3.11.15

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.
@@ -27,15 +27,19 @@ export function dueIn(dueDate, now = Date.now()) {
27
27
  if (!Number.isFinite(due))
28
28
  return null;
29
29
  const diffMs = due - now;
30
- const absMs = Math.abs(diffMs);
31
- if (absMs < HOUR_MS) {
32
- return relativeTimeFormat.format(Math.round(diffMs / MINUTE_MS), "minute");
30
+ // Pick the unit from the rounded count, not the raw distance: 23.6 hours
31
+ // rounds to 24, which reads as "tomorrow", not "in 24 hours".
32
+ const minutes = Math.round(diffMs / MINUTE_MS);
33
+ if (Math.abs(minutes) < 60) {
34
+ return relativeTimeFormat.format(minutes, "minute");
33
35
  }
34
- if (absMs < DAY_MS) {
35
- return relativeTimeFormat.format(Math.round(diffMs / HOUR_MS), "hour");
36
+ const hours = Math.round(diffMs / HOUR_MS);
37
+ if (Math.abs(hours) < 24) {
38
+ return relativeTimeFormat.format(hours, "hour");
36
39
  }
37
- if (absMs < WEEK_MS) {
38
- return relativeTimeFormat.format(Math.round(diffMs / DAY_MS), "day");
40
+ const days = Math.round(diffMs / DAY_MS);
41
+ if (Math.abs(days) < 7) {
42
+ return relativeTimeFormat.format(days, "day");
39
43
  }
40
44
  return relativeTimeFormat.format(Math.round(diffMs / WEEK_MS), "week");
41
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brightspace-mcp-server",
3
- "version": "3.11.14",
3
+ "version": "3.11.15",
4
4
  "mcpName": "io.github.RohanMuppa/brightspace",
5
5
  "description": "MCP server for Brightspace (D2L). Check grades, due dates, assignments, announcements, syllabus, rosters and more via Claude, ChatGPT, Cursor, Windsurf, or any MCP client.",
6
6
  "type": "module",