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

Function createTimeFormatHelper

src/utils/dateUtils.ts:991–1009  ·  view source on GitHub ↗
(userTimeFormat: "12" | "24")

Source from the content-addressed store, hash-verified

989 * Use this in UI components that have access to the plugin instance
990 */
991export function createTimeFormatHelper(userTimeFormat: "12" | "24") {
992 return {
993 formatDateTimeForDisplay: (
994 dateString: string,
995 options: {
996 dateFormat?: string;
997 timeFormat?: string;
998 showTime?: boolean;
999 } = {}
1000 ) => formatDateTimeForDisplay(dateString, { ...options, userTimeFormat }),
1001
1002 formatTime: (date: Date) => formatTime(date, userTimeFormat),
1003
1004 formatDateTime: (date: Date) => formatDateTime(date, userTimeFormat),
1005
1006 formatDateStringTime: (dateString: string) =>
1007 formatDateStringTime(dateString, userTimeFormat),
1008 };
1009}
1010
1011/**
1012 * Combine a date and time into a datetime string

Callers

nothing calls this directly

Calls 4

formatDateTimeForDisplayFunction · 0.85
formatDateStringTimeFunction · 0.85
formatTimeFunction · 0.70
formatDateTimeFunction · 0.70

Tested by

no test coverage detected