MCPcopy
hub / github.com/callumalpass/tasknotes / createUTCDateFromLocalCalendarDate

Function createUTCDateFromLocalCalendarDate

src/utils/dateUtils.ts:1416–1424  ·  view source on GitHub ↗
(localDate: Date)

Source from the content-addressed store, hash-verified

1414 * @returns A UTC date representing midnight UTC on that calendar date
1415 */
1416export function createUTCDateFromLocalCalendarDate(localDate: Date): Date {
1417 // Extract the local date components
1418 const year = localDate.getFullYear();
1419 const month = localDate.getMonth();
1420 const day = localDate.getDate();
1421
1422 // Create a UTC date for that calendar date
1423 return new Date(Date.UTC(year, month, day, 0, 0, 0, 0));
1424}
1425
1426/**
1427 * Checks if a UTC-anchored date object represents the user's local "today".

Callers 15

refreshStatsMethod · 0.90
getTodayStatsMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
toAnchoredDateStringMethod · 0.90
renderDayMethod · 0.90
navigateToTodayMethod · 0.90
getKanbanTaskActionDateFunction · 0.90
TaskListViewClass · 0.90
renderFlatMethod · 0.90

Calls 1

getDateMethod · 0.65

Tested by 1

determineCompletionDateFunction · 0.72