MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / isTodayTimeAware

Function isTodayTimeAware

src/utils/dateUtils.ts:1225–1244  ·  view source on GitHub ↗
(dateString: string)

Source from the content-addressed store, hash-verified

1223 * Check if a date/datetime represents today (time-aware)
1224 */
1225export function isTodayTimeAware(dateString: string): boolean {
1226 if (!dateString) return false;
1227
1228 try {
1229 const taskDate = hasTimeComponent(dateString)
1230 ? parseDateToLocalInternal(dateString)
1231 : parseDateAsLocal(dateString);
1232 const now = new Date();
1233
1234 return isSameDay(taskDate, now);
1235 } catch (error) {
1236 tasknotesLogger.error("Error checking if today:", {
1237 category: "validation",
1238 operation: "checking-if-today",
1239 details: { dateString },
1240 error: error,
1241 });
1242 return false;
1243 }
1244}
1245
1246/**
1247 * Validate datetime input (supports both date-only and date+time)

Callers 3

renderDueDatePropertyFunction · 0.90
dateUtils.test.tsFile · 0.90

Calls 5

hasTimeComponentFunction · 0.85
parseDateToLocalInternalFunction · 0.85
parseDateAsLocalFunction · 0.85
isSameDayFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected